Changeset 101 for java/main/src/main/java/com/framsticks/communication/ServerSideManagedConnection.java
- Timestamp:
- 07/14/13 23:20:04 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/communication/ServerSideManagedConnection.java
r100 r101 2 2 3 3 import com.framsticks.communication.queries.*; 4 import com.framsticks.params.SourceInterface;5 4 import com.framsticks.util.FramsticksException; 6 5 import com.framsticks.util.lang.Holder; … … 69 68 } 70 69 71 protected final void putFile(File file, String outId) {72 putLine("file" + outId/* + " " + f.getPath()*/);73 SourceInterface content = file.getContent();74 String line;75 while ((line = content.readLine()) != null) {76 putLine(line);77 }78 putLine("eof");79 }80 70 81 public final void sendFile(final String header, final File file) {82 senderThread.dispatch(new RunAt<Connection>(requestHandler) {83 @Override84 protected void runAt() {85 putLine(header);86 putFile(file, "");87 flushOut();88 }89 });90 }91 71 92 72 protected final void respond(final Response response, final Integer id) { … … 94 74 @Override 95 75 protected void runAt() { 96 String outId = id != null ? " " + id : "";97 76 if (response.getFiles() != null) { 98 77 for (File f : response.getFiles()) { 99 putFile(f, outId);78 putFile(f, id); 100 79 } 101 80 } 102 81 StringBuilder statusLine = new StringBuilder(); 103 statusLine.append(response.getOk() ? "ok" : "error").append( outId);82 statusLine.append(response.getOk() ? "ok" : "error").append(idToString(id)); 104 83 if (Strings.notEmpty(response.getComment())) { 105 84 Request.quoteValue(statusLine.append(" "), response.getComment());
Note: See TracChangeset
for help on using the changeset viewer.