Class Apache5ContentEntity

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.hc.core5.http.EntityDetails, org.apache.hc.core5.http.HttpEntity

    final class Apache5ContentEntity
    extends org.apache.hc.core5.http.io.entity.AbstractHttpEntity
    Translation class to make google-http-client entity conform with Apache 5.x AbstractHttpEntity
    • Constructor Summary

      Constructors 
      Constructor Description
      Apache5ContentEntity​(long contentLength, StreamingContent streamingContent, java.lang.String contentType, java.lang.String contentEncoding)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.io.InputStream getContent()  
      long getContentLength()  
      boolean isRepeatable()  
      boolean isStreaming()  
      void writeTo​(java.io.OutputStream out)  
      • Methods inherited from class org.apache.hc.core5.http.io.entity.AbstractHttpEntity

        getContentEncoding, getContentType, getTrailerNames, getTrailers, isChunked, toString, writeTo
      • Methods inherited from class java.lang.Object

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

      • contentLength

        private final long contentLength
        Content length or less than zero if not known.
      • streamingContent

        private final StreamingContent streamingContent
        Streaming content.
    • Constructor Detail

      • Apache5ContentEntity

        Apache5ContentEntity​(long contentLength,
                             StreamingContent streamingContent,
                             java.lang.String contentType,
                             java.lang.String contentEncoding)
        Parameters:
        contentLength - content length or less than zero if not known
        streamingContent - streaming content
    • Method Detail

      • getContent

        public java.io.InputStream getContent()
      • getContentLength

        public long getContentLength()
      • isRepeatable

        public boolean isRepeatable()
        Specified by:
        isRepeatable in interface org.apache.hc.core5.http.HttpEntity
        Overrides:
        isRepeatable in class org.apache.hc.core5.http.io.entity.AbstractHttpEntity
      • isStreaming

        public boolean isStreaming()
      • writeTo

        public void writeTo​(java.io.OutputStream out)
                     throws java.io.IOException
        Specified by:
        writeTo in interface org.apache.hc.core5.http.HttpEntity
        Overrides:
        writeTo in class org.apache.hc.core5.http.io.entity.AbstractHttpEntity
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException