Class AbstractHttpEntity

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractHttpEntity​(java.lang.String contentType, java.lang.String contentEncoding)  
      protected AbstractHttpEntity​(java.lang.String contentType, java.lang.String contentEncoding, boolean chunked)  
      protected AbstractHttpEntity​(ContentType contentType, java.lang.String contentEncoding)  
      protected AbstractHttpEntity​(ContentType contentType, java.lang.String contentEncoding, boolean chunked)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentEncoding()
      Returns content encoding of the entity, if known.
      java.lang.String getContentType()
      Returns content type of the entity, if known.
      java.util.Set<java.lang.String> getTrailerNames()
      Preliminary declaration of trailing headers.
      Supplier<java.util.List<? extends Header>> getTrailers()
      Returns supplier of message trailers - headers sent after message body.
      boolean isChunked()
      Returns chunked transfer hint for this entity.
      boolean isRepeatable()
      Tells if the entity is capable of producing its data more than once.
      java.lang.String toString()  
      void writeTo​(java.io.OutputStream outStream)
      Writes the entity content out to the output stream.
      static void writeTo​(HttpEntity entity, java.io.OutputStream outStream)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.io.Closeable

        close
    • Field Detail

      • contentType

        private final java.lang.String contentType
      • contentEncoding

        private final java.lang.String contentEncoding
      • chunked

        private final boolean chunked
    • Constructor Detail

      • AbstractHttpEntity

        protected AbstractHttpEntity​(java.lang.String contentType,
                                     java.lang.String contentEncoding,
                                     boolean chunked)
      • AbstractHttpEntity

        protected AbstractHttpEntity​(ContentType contentType,
                                     java.lang.String contentEncoding,
                                     boolean chunked)
      • AbstractHttpEntity

        protected AbstractHttpEntity​(java.lang.String contentType,
                                     java.lang.String contentEncoding)
      • AbstractHttpEntity

        protected AbstractHttpEntity​(ContentType contentType,
                                     java.lang.String contentEncoding)
    • Method Detail

      • writeTo

        public static void writeTo​(HttpEntity entity,
                                   java.io.OutputStream outStream)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.io.OutputStream outStream)
                     throws java.io.IOException
        Description copied from interface: HttpEntity
        Writes the entity content out to the output stream.

        IMPORTANT: Please note all entity implementations must ensure that all allocated resources are properly deallocated when this method returns.

        Specified by:
        writeTo in interface HttpEntity
        Parameters:
        outStream - the output stream to write entity content to
        Throws:
        java.io.IOException - if an I/O error occurs
      • getContentType

        public final java.lang.String getContentType()
        Description copied from interface: EntityDetails
        Returns content type of the entity, if known.
        Specified by:
        getContentType in interface EntityDetails
      • getContentEncoding

        public final java.lang.String getContentEncoding()
        Description copied from interface: EntityDetails
        Returns content encoding of the entity, if known.
        Specified by:
        getContentEncoding in interface EntityDetails
      • isChunked

        public final boolean isChunked()
        Description copied from interface: EntityDetails
        Returns chunked transfer hint for this entity.

        The behavior of wrapping entities is implementation dependent, but should respect the primary purpose.

        Specified by:
        isChunked in interface EntityDetails
      • isRepeatable

        public boolean isRepeatable()
        Description copied from interface: HttpEntity
        Tells if the entity is capable of producing its data more than once. A repeatable entity's getContent() and writeTo(OutputStream) methods can be called more than once whereas a non-repeatable entity's can not.
        Specified by:
        isRepeatable in interface HttpEntity
        Returns:
        true if the entity is repeatable, false otherwise.
      • getTrailers

        public Supplier<java.util.List<? extends Header>> getTrailers()
        Description copied from interface: HttpEntity
        Returns supplier of message trailers - headers sent after message body. May return null if trailers are not available.
        Specified by:
        getTrailers in interface HttpEntity
      • getTrailerNames

        public java.util.Set<java.lang.String> getTrailerNames()
        Description copied from interface: EntityDetails
        Preliminary declaration of trailing headers.
        Specified by:
        getTrailerNames in interface EntityDetails
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object