public class HTTPResponseContent
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CONTENT_READ_CHUNKED
The content was read in chunks because the HTTP response header field 'Transfer-Encoding: chunked' was set.
|
static int |
CONTENT_READ_FIXED_LENGTH
The content was read by the size set in the HTTP response header field 'Content-Length'.
|
static int |
CONTENT_READ_IGNORED
The content was not read because a HTTP 'HEAD' request was sent.
|
static int |
CONTENT_READ_UNTIL_END_OF_STREAM
The content was read until the end of the stream because a HTTP 1.0 response has received with no hint about how to read the content.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getContent()
High-level function: Get the (decompressed) response content as a single byte array.
|
java.lang.String |
getContentAsString()
High-level function: Get the (decompressed) response content as a string.
|
int |
getContentReadMethod()
Get the way how the content was read.
|
long |
getContentReceiveTimeMillis()
Get the elapsed time duration for receiving the content data.
|
HTTPRequestHeader |
getHttpRequestHeader()
Get the corresponding HTTP request header which was sent to the server.
|
HTTPResponseHeader |
getHttpResponseHeader()
Get the corresponding HTTP response header which was received from the server.
|
byte[] |
getRawMergedContent()
High-level function: Merge the raw received content fragments to one byte array.
|
java.util.ArrayList<byte[]> |
getRawReceivedContent()
Get the raw received content.
|
long |
getRawReceivedContentLength()
Get the raw received content length (the number of the received response content bytes from the Web server).
|
long |
getStartContentReceiveTimestamp()
Get the timestamp of the start of receiving the content data.
|
boolean |
hasContent()
Get if any content has received.
|
void |
traceContent()
Dump the HTTP response content at log level 'trace' to the log adapter.
|
public static final int CONTENT_READ_IGNORED
public static final int CONTENT_READ_FIXED_LENGTH
public static final int CONTENT_READ_CHUNKED
public static final int CONTENT_READ_UNTIL_END_OF_STREAM
public HTTPRequestHeader getHttpRequestHeader()
public HTTPResponseHeader getHttpResponseHeader()
public int getContentReadMethod()
CONTENT_READ_IGNORED,
CONTENT_READ_FIXED_LENGTH,
CONTENT_READ_CHUNKED,
CONTENT_READ_UNTIL_END_OF_STREAMpublic boolean hasContent()
public long getRawReceivedContentLength()
public java.util.ArrayList<byte[]> getRawReceivedContent()
public byte[] getRawMergedContent()
throws HTTPContentTooLargeException
HTTPContentTooLargeException - if the received content is larger than 2^31-1 bytespublic byte[] getContent()
throws HTTPContentTooLargeException,
java.io.IOException
HTTPContentTooLargeException - if the received content is larger than 2^31-1 bytesjava.io.IOException - if the content was compressed and the decompression failspublic java.lang.String getContentAsString()
throws HTTPContentTooLargeException,
java.io.IOException
HTTPContentTooLargeException - if the received content is larger than 2^31-1 bytesjava.io.IOException - if the content was compressed and the decompression failspublic long getStartContentReceiveTimestamp()
public long getContentReceiveTimeMillis()
public void traceContent()
throws java.io.IOException
HTTPContentTooLargeException - if the received content is larger than 2^31-1 bytesjava.io.IOException - if the content was compressed and the decompression fails