| java.lang.Object com.gargoylesoftware.htmlunit.WebResponseData
WebResponseData | public class WebResponseData implements Serializable(Code) | | Simple data object to simplify WebResponse creation.
version: $Revision: 2132 $ author: Brad Clarke author: Daniel Gredler author: Ahmed Ashour |
WebResponseData | public WebResponseData(byte[] body, int statusCode, String statusMessage, List responseHeaders)(Code) | | Construct with a raw byte[] (mostly for testing)
Parameters: body - Body of this response Parameters: statusCode - Status code from the server Parameters: statusMessage - Status message from the server Parameters: responseHeaders - Headers in this response |
WebResponseData | public WebResponseData(InputStream bodyStream, int statusCode, String statusMessage, List responseHeaders) throws IOException(Code) | | Construct with a data stream to minimize copying of the entire body.
Parameters: bodyStream - Stream of this response's body Parameters: statusCode - Status code from the server Parameters: statusMessage - Status message from the server Parameters: responseHeaders - Headers in this response throws: IOException - on stream errors |
WebResponseData | protected WebResponseData(int statusCode, String statusMessage, List responseHeaders) throws IOException(Code) | | Construct without data stream for subclasses that override getBody()
Parameters: statusCode - Status code from the server Parameters: statusMessage - Status message from the server Parameters: responseHeaders - Headers in this response throws: IOException - on stream errors |
getBody | protected byte[] getBody(InputStream stream, List headers) throws IOException(Code) | | Returns the body byte array contained by the specified input stream.
If the response headers indicate that the data has been compressed,
the data stream is handled appropriately. If the specified stream is
null, this method returns null.
Parameters: stream - The input stream which contains the body. Parameters: headers - The response headers. The specified body stream, as a byte array. throws: IOException - If a stream error occurs. |
getBody | public byte[] getBody()(Code) | | Return the response body.
response body. |
getResponseHeaders | public List getResponseHeaders()(Code) | | response headers |
getStatusCode | public int getStatusCode()(Code) | | response status code |
getStatusMessage | public String getStatusMessage()(Code) | | response status message |
|
|