Class DefaultHttpResponse

  • All Implemented Interfaces:
    HTTPResponse

    public class DefaultHttpResponse
    extends Object
    implements HTTPResponse
    HTTPResponse that uses URLConnection as its basis.
    Author:
    Roar Brænden
    • Method Detail

      • dispose

        public void dispose()
        Description copied from interface: HTTPResponse
        Disposes this HTTP response and cleans up any resource being held.

        Multiple invocations of this method shall not raise an exception but return silently.

        Specified by:
        dispose in interface HTTPResponse
      • getResponseStream

        public InputStream getResponseStream()
                                      throws IOException
        Description copied from interface: HTTPResponse
        Returns the HTTP response content byte stream, automatically recognizing gzip encoded responses and returning an uncompressing stream if that's the case.
        Specified by:
        getResponseStream in interface HTTPResponse
        Throws:
        IOException - if such happens when obtaining the response stream.
      • getResponseCharset

        public String getResponseCharset()
        Specified by:
        getResponseCharset in interface HTTPResponse
        Returns:
        the response charset parsed out of the content type response header, if any, or null otherwise.