Class ApacheHttpClient5Transport.ContentCompressingEntity
java.lang.Object
org.apache.hc.core5.http.io.entity.HttpEntityWrapper
org.opensearch.client.transport.httpclient5.ApacheHttpClient5Transport.ContentCompressingEntity
- All Implemented Interfaces:
Closeable,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.HttpEntityWrapper
A gzip compressing entity that also implements
getContent().-
Constructor Summary
ConstructorsConstructorDescriptionContentCompressingEntity(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
Modifier and TypeMethodDescriptionReturns a content stream of the entity.Returns content encoding of the entity, if known.longA gzip entity requires content length in http headers.booleanA gzip compressing entity doesn't work with chunked encoding with sigv4voidwriteTo(OutputStream outStream) Writes the entity content out to the output stream.Methods inherited from class org.apache.hc.core5.http.io.entity.HttpEntityWrapper
close, getContentType, getTrailerNames, getTrailers, isRepeatable, isStreaming, toString
-
Constructor Details
-
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 Details
-
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
Returns 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:
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
Writes 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:
IOException- if an I/O error occurs
-