Debian Codegraph @

src/main/java/net/sf/antcontrib/antserver/Response.java

raw symbols SCIP
1 /*
2 * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
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 * Place class description here.
24 *
25 * @author <a href='mailto:[email protected]'>Matthew Inger</a>
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 }