| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
package net.sf.antcontrib.antserver; |
| 17 |
|
| 18 |
import java.io.ByteArrayOutputStream; |
| 19 |
import java.io.PrintStream; |
| 20 |
import java.io.Serializable; |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
public class Response |
| 31 |
implements Serializable |
| 32 |
{ |
| 33 |
private boolean succeeded; |
| 34 |
private String errorStackTrace; |
| 35 |
private String errorMessage; |
| 36 |
private String resultsXml; |
| 37 |
|
| 38 |
private long contentLength; |
| 39 |
|
| 40 |
public Response() |
| 41 |
{ |
| 42 |
super(); |
| 43 |
this.succeeded = true; |
| 44 |
} |
| 45 |
|
| 46 |
|
| 47 |
public boolean isSucceeded() |
| 48 |
{ |
| 49 |
return succeeded; |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
public void setSucceeded(boolean succeeded) |
| 54 |
{ |
| 55 |
this.succeeded = succeeded; |
| 56 |
} |
| 57 |
|
| 58 |
public void setThrowable(Throwable t) |
| 59 |
{ |
| 60 |
errorMessage = t.getMessage(); |
| 61 |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| 62 |
PrintStream ps = new PrintStream(baos); |
| 63 |
t.printStackTrace(ps); |
| 64 |
ps.flush(); |
| 65 |
setErrorStackTrace(baos.toString()); |
| 66 |
} |
| 67 |
|
| 68 |
public String getErrorStackTrace() |
| 69 |
{ |
| 70 |
return errorStackTrace; |
| 71 |
} |
| 72 |
|
| 73 |
|
| 74 |
public void setErrorStackTrace(String errorStackTrace) |
| 75 |
{ |
| 76 |
this.errorStackTrace = errorStackTrace; |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
public String getErrorMessage() |
| 81 |
{ |
| 82 |
return errorMessage; |
| 83 |
} |
| 84 |
|
| 85 |
|
| 86 |
public void setErrorMessage(String errorMessage) |
| 87 |
{ |
| 88 |
this.errorMessage = errorMessage; |
| 89 |
} |
| 90 |
|
| 91 |
|
| 92 |
public String getResultsXml() |
| 93 |
{ |
| 94 |
return resultsXml; |
| 95 |
} |
| 96 |
|
| 97 |
|
| 98 |
public void setResultsXml(String resultsXml) |
| 99 |
{ |
| 100 |
this.resultsXml = resultsXml; |
| 101 |
} |
| 102 |
|
| 103 |
public long getContentLength() |
| 104 |
{ |
| 105 |
return contentLength; |
| 106 |
} |
| 107 |
|
| 108 |
public void setContentLength(long contentLength) |
| 109 |
{ |
| 110 |
this.contentLength = contentLength; |
| 111 |
} |
| 112 |
} |