|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gargoylesoftware.htmlunit.WebResponseData
public class WebResponseData
Simple data object to simplify WebResponse creation.
| Constructor Summary | |
|---|---|
|
WebResponseData(byte[] body,
int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
Constructs with a raw byte[] (mostly for testing). |
|
WebResponseData(InputStream bodyStream,
int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
Constructs with a data stream to minimize copying of the entire body. |
protected |
WebResponseData(int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
Constructs without data stream for subclasses that override getBody(). |
| Method Summary | |
|---|---|
byte[] |
getBody()
Returns the response body. |
protected byte[] |
getBody(InputStream stream,
List<NameValuePair> headers)
Returns the body byte array contained by the specified input stream. |
List<NameValuePair> |
getResponseHeaders()
|
int |
getStatusCode()
|
String |
getStatusMessage()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebResponseData(byte[] body,
int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
body - Body of this responsestatusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this response
public WebResponseData(InputStream bodyStream,
int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
throws IOException
bodyStream - Stream of this response's bodystatusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this response
IOException - on stream errors
protected WebResponseData(int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
throws IOException
statusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this response
IOException - on stream errors| Method Detail |
|---|
protected byte[] getBody(InputStream stream,
List<NameValuePair> headers)
throws IOException
stream - the input stream which contains the bodyheaders - the response headers
IOException - if a stream error occurspublic byte[] getBody()
public List<NameValuePair> getResponseHeaders()
public int getStatusCode()
public String getStatusMessage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||