Class MockWebConnection.RawResponseData
java.lang.Object
org.htmlunit.MockWebConnection.RawResponseData
- Enclosing class:
MockWebConnection
Contains the raw data configured for a response.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]private Charsetprivate final List<NameValuePair> private final intprivate final Stringprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionRawResponseData(byte[] byteContent, int statusCode, String statusMessage, String contentType, List<NameValuePair> headers) RawResponseData(String stringContent, Charset charset, int statusCode, String statusMessage, String contentType, List<NameValuePair> headers) -
Method Summary
Modifier and TypeMethodDescription(package private) WebResponseDataprivate static List<NameValuePair> compileHeaders(List<NameValuePair> headers, String contentType) byte[]Gets the configured content bytes.Gets the configured charset.Gets the configured headers.intGets the configured status code.Gets the configured status message.Gets the configured content String.
-
Field Details
-
headers_
-
byteContent_
private final byte[] byteContent_ -
stringContent_
-
statusCode_
private final int statusCode_ -
statusMessage_
-
charset_
-
-
Constructor Details
-
RawResponseData
RawResponseData(byte[] byteContent, int statusCode, String statusMessage, String contentType, List<NameValuePair> headers) -
RawResponseData
-
-
Method Details
-
compileHeaders
-
asWebResponseData
WebResponseData asWebResponseData() -
getHeaders
-
getByteContent
public byte[] getByteContent()Gets the configured content bytes.- Returns:
nullif a String content has been configured
-
getStringContent
Gets the configured content String.- Returns:
nullif a byte content has been configured
-
getStatusCode
public int getStatusCode()Gets the configured status code.- Returns:
- the status code
-
getStatusMessage
-
getCharset
-