public class WebResponseData extends Object implements Serializable
Modifier | Constructor and Description |
---|---|
|
WebResponseData(byte[] body,
int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
Constructs with a raw byte[] (mostly for testing).
|
|
WebResponseData(DownloadedContent downloadedContent,
int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
Constructor.
|
protected |
WebResponseData(int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
Constructs without data stream for subclasses that override getBody().
|
Modifier and Type | Method and Description |
---|---|
void |
cleanUp()
Clean up the downloaded content.
|
byte[] |
getBody()
Returns the response body.
|
InputStream |
getInputStream()
Returns a new
InputStream allowing to read the downloaded content. |
List<NameValuePair> |
getResponseHeaders() |
int |
getStatusCode() |
String |
getStatusMessage() |
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 responseprotected WebResponseData(int statusCode, String statusMessage, List<NameValuePair> responseHeaders)
statusCode
- Status code from the serverstatusMessage
- Status message from the serverresponseHeaders
- Headers in this responsepublic WebResponseData(DownloadedContent downloadedContent, int statusCode, String statusMessage, List<NameValuePair> responseHeaders)
downloadedContent
- the downloaded contentstatusCode
- Status code from the serverstatusMessage
- Status message from the serverresponseHeaders
- Headers in this responsepublic byte[] getBody()
public InputStream getInputStream() throws IOException
InputStream
allowing to read the downloaded content.IOException
- in case of IO problemspublic List<NameValuePair> getResponseHeaders()
public int getStatusCode()
public String getStatusMessage()
public void cleanUp()
Copyright © 2002–2017 Gargoyle Software Inc.. All rights reserved.