Class HttpURLConnectionResponseAdapter

  • All Implemented Interfaces:
    HttpResponse

    public class HttpURLConnectionResponseAdapter
    extends java.lang.Object
    implements HttpResponse
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.net.HttpURLConnection connection  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.InputStream getContent()  
      java.lang.String getReasonPhrase()  
      int getStatusCode()  
      java.lang.Object unwrap()
      Returns the underlying response object, in case you need to work on it directly.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • connection

        private java.net.HttpURLConnection connection
    • Constructor Detail

      • HttpURLConnectionResponseAdapter

        public HttpURLConnectionResponseAdapter​(java.net.HttpURLConnection connection)
    • Method Detail

      • getContent

        public java.io.InputStream getContent()
                                       throws java.io.IOException
        Specified by:
        getContent in interface HttpResponse
        Throws:
        java.io.IOException
      • getStatusCode

        public int getStatusCode()
                          throws java.io.IOException
        Specified by:
        getStatusCode in interface HttpResponse
        Throws:
        java.io.IOException
      • getReasonPhrase

        public java.lang.String getReasonPhrase()
                                         throws java.lang.Exception
        Specified by:
        getReasonPhrase in interface HttpResponse
        Throws:
        java.lang.Exception
      • unwrap

        public java.lang.Object unwrap()
        Description copied from interface: HttpResponse
        Returns the underlying response object, in case you need to work on it directly.
        Specified by:
        unwrap in interface HttpResponse
        Returns:
        the wrapped response object