Changeset 99 for java/main/src/main/java/com/framsticks/communication/ServerSideManagedConnection.java
- Timestamp:
- 07/10/13 22:41:02 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/communication/ServerSideManagedConnection.java
r98 r99 68 68 } 69 69 70 protected final void putFile(File file, String outId) { 71 putLine("file" + outId/* + " " + f.getPath()*/); 72 SourceInterface content = file.getContent(); 73 String line; 74 while ((line = content.readLine()) != null) { 75 putLine(line); 76 } 77 putLine("eof"); 78 } 79 80 public final void sendFile(final String header, final File file) { 81 senderThread.dispatch(new RunAt<Connection>(requestHandler) { 82 @Override 83 protected void runAt() { 84 putLine(header); 85 putFile(file, ""); 86 flushOut(); 87 } 88 }); 89 } 90 70 91 protected final void respond(final Response response, final Integer id) { 71 92 senderThread.dispatch(new RunAt<Connection>(requestHandler) { … … 75 96 if (response.getFiles() != null) { 76 97 for (File f : response.getFiles()) { 77 putLine("file" + outId/* + " " + f.getPath()*/); 78 SourceInterface content = f.getContent(); 79 String line; 80 while ((line = content.readLine()) != null) { 81 putLine(line); 82 } 83 putLine("eof"); 98 putFile(f, outId); 84 99 } 85 100 } … … 87 102 statusLine.append(response.getOk() ? "ok" : "error").append(outId); 88 103 if (Strings.notEmpty(response.getComment())) { 89 statusLine.append(" \"").append(response.getComment()).append('"');104 Request.quoteValue(statusLine.append(" "), response.getComment()); 90 105 } 91 106 putLine(statusLine.toString());
Note: See TracChangeset
for help on using the changeset viewer.