1 22 package org.netbeans.lib.cvsclient.response; 23 24 import java.io.*; 25 26 import org.netbeans.lib.cvsclient.event.*; 27 import org.netbeans.lib.cvsclient.util.*; 28 29 36 public final class ErrorMessageResponse implements Response { 37 38 private boolean terminating; 39 40 private String message; 41 42 48 public void process(LoggedDataInputStream dis, ResponseServices services) 49 throws ResponseException { 50 try { 51 final String line = dis.readLine(); 52 terminating |= line.endsWith(SpecialResponses.SERVER_ABORTED); 53 terminating |= line.endsWith(SpecialResponses.SERVER_ABORTED_2); 54 terminating |= line.endsWith(SpecialResponses.SERVER_ABORTED_3); 55 terminating &= dis.available() == 0; message = line; 57 MessageEvent event = new MessageEvent(this, line, true); 58 services.getEventManager().fireCVSEvent(event); 59 } 60 catch (EOFException ex) { 61 throw new ResponseException(ex, ResponseException.getLocalMessage("CommandException.EndOfFile", null)); } 63 catch (IOException ex) { 64 throw new ResponseException(ex); 65 } 66 } 67 68 72 public boolean isTerminalResponse() { 73 return terminating; 74 } 75 76 79 public String getMessage() { 80 return message; 81 } 82 83 } 84 | Popular Tags |