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.
|
long |
getContentLength()
Returns length of the content data.
|
InputStream |
getInputStream()
Returns a new
InputStream allowing to read the downloaded content. |
InputStream |
getInputStreamWithBomIfApplicable(org.apache.commons.io.ByteOrderMark... bomHeaders)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
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 InputStream getInputStreamWithBomIfApplicable(org.apache.commons.io.ByteOrderMark... bomHeaders) throws IOException
bomHeaders
- the supported bomHeadersIOException
- in case of IO problemspublic List<NameValuePair> getResponseHeaders()
public int getStatusCode()
public String getStatusMessage()
public long getContentLength()
public void cleanUp()
Copyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.