Class HttpURLConnectionRequestAdapter

  • All Implemented Interfaces:
    HttpRequest

    public class HttpURLConnectionRequestAdapter
    extends java.lang.Object
    implements HttpRequest
    • Field Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.String> getAllHeaders()  
      java.lang.String getContentType()  
      java.lang.String getHeader​(java.lang.String name)  
      java.io.InputStream getMessagePayload()  
      java.lang.String getMethod()  
      java.lang.String getRequestUrl()  
      void setHeader​(java.lang.String name, java.lang.String value)  
      void setRequestUrl​(java.lang.String url)  
      java.net.HttpURLConnection unwrap()
      Returns the wrapped request object, in case you must work directly on it.
      • Methods inherited from class java.lang.Object

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

      • connection

        protected java.net.HttpURLConnection connection
    • Constructor Detail

      • HttpURLConnectionRequestAdapter

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

      • getMethod

        public java.lang.String getMethod()
        Specified by:
        getMethod in interface HttpRequest
      • setRequestUrl

        public void setRequestUrl​(java.lang.String url)
        Specified by:
        setRequestUrl in interface HttpRequest
      • setHeader

        public void setHeader​(java.lang.String name,
                              java.lang.String value)
        Specified by:
        setHeader in interface HttpRequest
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
        Specified by:
        getHeader in interface HttpRequest
      • getAllHeaders

        public java.util.Map<java.lang.String,​java.lang.String> getAllHeaders()
        Specified by:
        getAllHeaders in interface HttpRequest
      • getMessagePayload

        public java.io.InputStream getMessagePayload()
                                              throws java.io.IOException
        Specified by:
        getMessagePayload in interface HttpRequest
        Throws:
        java.io.IOException
      • unwrap

        public java.net.HttpURLConnection unwrap()
        Description copied from interface: HttpRequest
        Returns the wrapped request object, in case you must work directly on it.
        Specified by:
        unwrap in interface HttpRequest
        Returns:
        the wrapped request object