Class ApacheHttpClient5Transport.ContentCompressingEntity
- java.lang.Object
-
- org.apache.hc.core5.http.io.entity.HttpEntityWrapper
-
- org.opensearch.client.transport.httpclient5.ApacheHttpClient5Transport.ContentCompressingEntity
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.hc.core5.http.EntityDetails,org.apache.hc.core5.http.HttpEntity
- Enclosing class:
- ApacheHttpClient5Transport
public static class ApacheHttpClient5Transport.ContentCompressingEntity extends org.apache.hc.core5.http.io.entity.HttpEntityWrapperA gzip compressing entity that also implementsgetContent().
-
-
Constructor Summary
Constructors Constructor Description ContentCompressingEntity(org.apache.hc.core5.http.HttpEntity entity)Creates aApacheHttpClient5Transport.ContentCompressingEntityinstance with the provided HTTP entity.ContentCompressingEntity(org.apache.hc.core5.http.HttpEntity entity, boolean chunkedEnabled)Creates aApacheHttpClient5Transport.ContentCompressingEntityinstance with the provided HTTP entity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetContent()Returns a content stream of the entity.java.lang.StringgetContentEncoding()Returns content encoding of the entity, if known.longgetContentLength()A gzip entity requires content length in http headers.booleanisChunked()A gzip compressing entity doesn't work with chunked encoding with sigv4voidwriteTo(java.io.OutputStream outStream)Writes the entity content out to the output stream.
-
-
-
Constructor Detail
-
ContentCompressingEntity
public ContentCompressingEntity(org.apache.hc.core5.http.HttpEntity entity)
Creates aApacheHttpClient5Transport.ContentCompressingEntityinstance with the provided HTTP entity.- Parameters:
entity- the HTTP entity.
-
ContentCompressingEntity
public ContentCompressingEntity(org.apache.hc.core5.http.HttpEntity entity, boolean chunkedEnabled)Creates aApacheHttpClient5Transport.ContentCompressingEntityinstance with the provided HTTP entity.- Parameters:
entity- the HTTP entity.chunkedEnabled- force enable/disable chunked transfer-encoding.
-
-
Method Detail
-
getContentEncoding
public java.lang.String getContentEncoding()
Returns content encoding of the entity, if known.- Specified by:
getContentEncodingin interfaceorg.apache.hc.core5.http.EntityDetails- Overrides:
getContentEncodingin classorg.apache.hc.core5.http.io.entity.HttpEntityWrapper
-
getContent
public java.io.InputStream getContent() throws java.io.IOExceptionReturns a content stream of the entity.- Specified by:
getContentin interfaceorg.apache.hc.core5.http.HttpEntity- Overrides:
getContentin classorg.apache.hc.core5.http.io.entity.HttpEntityWrapper- Throws:
java.io.IOException
-
isChunked
public boolean isChunked()
A gzip compressing entity doesn't work with chunked encoding with sigv4- Specified by:
isChunkedin interfaceorg.apache.hc.core5.http.EntityDetails- Overrides:
isChunkedin classorg.apache.hc.core5.http.io.entity.HttpEntityWrapper- Returns:
- false
-
getContentLength
public long getContentLength()
A gzip entity requires content length in http headers.- Specified by:
getContentLengthin interfaceorg.apache.hc.core5.http.EntityDetails- Overrides:
getContentLengthin classorg.apache.hc.core5.http.io.entity.HttpEntityWrapper- Returns:
- content length of gzip entity
-
writeTo
public void writeTo(java.io.OutputStream outStream) throws java.io.IOExceptionWrites the entity content out to the output stream.- Specified by:
writeToin interfaceorg.apache.hc.core5.http.HttpEntity- Overrides:
writeToin classorg.apache.hc.core5.http.io.entity.HttpEntityWrapper- Parameters:
outStream- the output stream to write entity content to- Throws:
java.io.IOException- if an I/O error occurs
-
-