|
||||||||||
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 responseHeaders)
Construct with a raw byte[] (mostly for testing) |
|
WebResponseData(InputStream bodyStream,
int statusCode,
String statusMessage,
List responseHeaders)
Construct with a data stream to minimize copying of the entire body. |
protected |
WebResponseData(int statusCode,
String statusMessage,
List responseHeaders)
Construct without data stream for subclasses that override getBody() |
Method Summary | |
---|---|
byte[] |
getBody()
Return the response body. |
protected byte[] |
getBody(InputStream stream,
List headers)
Returns the body byte array contained by the specified input stream. |
List |
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 responseHeaders)
body
- Body of this responsestatusCode
- Status code from the serverstatusMessage
- Status message from the serverresponseHeaders
- Headers in this responsepublic WebResponseData(InputStream bodyStream, int statusCode, String statusMessage, List 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 errorsprotected WebResponseData(int statusCode, String statusMessage, List responseHeaders) throws IOException
statusCode
- Status code from the serverstatusMessage
- Status message from the serverresponseHeaders
- Headers in this response
IOException
- on stream errorsMethod Detail |
---|
protected byte[] getBody(InputStream stream, List headers) throws IOException
stream
- The input stream which contains the body.headers
- The response headers.
IOException
- If a stream error occurs.public byte[] getBody()
public List getResponseHeaders()
public int getStatusCode()
public String getStatusMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |