com.gargoylesoftware.htmlunit
Class WebResponseData

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.WebResponseData
All Implemented Interfaces:
java.io.Serializable

public class WebResponseData
extends java.lang.Object
implements java.io.Serializable

Simple data object to simplify WebResponse creation.

Version:
$Revision: 1.3 $
Author:
Brad Clarke, Daniel Gredler, Ahmed Ashour
See Also:
Serialized Form

Constructor Summary
WebResponseData(byte[] body, int statusCode, java.lang.String statusMessage, java.util.List responseHeaders)
 Construct with a raw byte[] (mostly for testing)
WebResponseData(java.io.InputStream bodyStream, int statusCode, java.lang.String statusMessage, java.util.List responseHeaders)
 Construct with a data stream to minimize copying of the entire body.
 
Method Summary
 byte[] getBody()
 Return the response body.
 java.util.List getResponseHeaders()
  
 int getStatusCode()
  
 java.lang.String getStatusMessage()
  
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebResponseData

public WebResponseData(byte[] body,
                       int statusCode,
                       java.lang.String statusMessage,
                       java.util.List responseHeaders)
Construct with a raw byte[] (mostly for testing)

Parameters:
body - Body of this response
statusCode - Status code from the server
statusMessage - Status message from the server
responseHeaders - Headers in this response

WebResponseData

public WebResponseData(java.io.InputStream bodyStream,
                       int statusCode,
                       java.lang.String statusMessage,
                       java.util.List responseHeaders)
                throws java.io.IOException
Construct with a data stream to minimize copying of the entire body.

Parameters:
bodyStream - Stream of this response's body
statusCode - Status code from the server
statusMessage - Status message from the server
responseHeaders - Headers in this response
Throws:
java.io.IOException - on stream errors
Method Detail

getBody

public byte[] getBody()
Return the response body.

Returns:
response body.

getResponseHeaders

public java.util.List getResponseHeaders()
Returns:
response headers

getStatusCode

public int getStatusCode()
Returns:
response status code

getStatusMessage

public java.lang.String getStatusMessage()
Returns:
response status message


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.