Package org.htmlunit

Class MockWebConnection.RawResponseData

  • Enclosing class:
    MockWebConnection

    public static class MockWebConnection.RawResponseData
    extends java.lang.Object
    Contains the raw data configured for a response.
    • Field Detail

      • byteContent_

        private final byte[] byteContent_
      • stringContent_

        private final java.lang.String stringContent_
      • statusCode_

        private final int statusCode_
      • statusMessage_

        private final java.lang.String statusMessage_
      • charset_

        private java.nio.charset.Charset charset_
    • Constructor Detail

      • RawResponseData

        RawResponseData​(byte[] byteContent,
                        int statusCode,
                        java.lang.String statusMessage,
                        java.lang.String contentType,
                        java.util.List<NameValuePair> headers)
      • RawResponseData

        RawResponseData​(java.lang.String stringContent,
                        java.nio.charset.Charset charset,
                        int statusCode,
                        java.lang.String statusMessage,
                        java.lang.String contentType,
                        java.util.List<NameValuePair> headers)
    • Method Detail

      • compileHeaders

        private static java.util.List<NameValuePair> compileHeaders​(java.util.List<NameValuePair> headers,
                                                                    java.lang.String contentType)
      • getHeaders

        public java.util.List<NameValuePair> getHeaders()
        Gets the configured headers.
        Returns:
        the headers
      • getByteContent

        public byte[] getByteContent()
        Gets the configured content bytes.
        Returns:
        null if a String content has been configured
      • getStringContent

        public java.lang.String getStringContent()
        Gets the configured content String.
        Returns:
        null if a byte content has been configured
      • getStatusCode

        public int getStatusCode()
        Gets the configured status code.
        Returns:
        the status code
      • getStatusMessage

        public java.lang.String getStatusMessage()
        Gets the configured status message.
        Returns:
        the message
      • getCharset

        public java.nio.charset.Charset getCharset()
        Gets the configured charset.
        Returns:
        null for byte content