Package org.opensearch.client
Class RestClient.ContentCompressingEntity
java.lang.Object
org.apache.http.entity.HttpEntityWrapper
org.apache.http.client.entity.GzipCompressingEntity
org.opensearch.client.RestClient.ContentCompressingEntity
- All Implemented Interfaces:
org.apache.http.HttpEntity
- Enclosing class:
RestClient
public static class RestClient.ContentCompressingEntity
extends org.apache.http.client.entity.GzipCompressingEntity
A gzip compressing entity that also implements
getContent().-
Field Summary
Fields inherited from class org.apache.http.entity.HttpEntityWrapper
wrappedEntity -
Constructor Summary
ConstructorsConstructorDescriptionContentCompressingEntity(org.apache.http.HttpEntity entity) Creates aRestClient.ContentCompressingEntityinstance with the provided HTTP entity.ContentCompressingEntity(org.apache.http.HttpEntity entity, boolean chunkedEnabled) Creates aRestClient.ContentCompressingEntityinstance with the provided HTTP entity. -
Method Summary
Modifier and TypeMethodDescriptionlongA gzip entity requires content length in http headers.booleanA gzip compressing entity doesn't work with chunked encoding with sigv4Methods inherited from class org.apache.http.client.entity.GzipCompressingEntity
getContentEncoding, writeToMethods inherited from class org.apache.http.entity.HttpEntityWrapper
consumeContent, getContentType, isRepeatable, isStreaming
-
Constructor Details
-
ContentCompressingEntity
public ContentCompressingEntity(org.apache.http.HttpEntity entity) Creates aRestClient.ContentCompressingEntityinstance with the provided HTTP entity.- Parameters:
entity- the HTTP entity.
-
ContentCompressingEntity
public ContentCompressingEntity(org.apache.http.HttpEntity entity, boolean chunkedEnabled) Creates aRestClient.ContentCompressingEntityinstance with the provided HTTP entity.- Parameters:
entity- the HTTP entity.chunkedEnabled- force enable/disable chunked transfer-encoding.
-
-
Method Details
-
getContent
- Specified by:
getContentin interfaceorg.apache.http.HttpEntity- Overrides:
getContentin classorg.apache.http.client.entity.GzipCompressingEntity- Throws:
IOException
-
isChunked
public boolean isChunked()A gzip compressing entity doesn't work with chunked encoding with sigv4- Specified by:
isChunkedin interfaceorg.apache.http.HttpEntity- Overrides:
isChunkedin classorg.apache.http.client.entity.GzipCompressingEntity- Returns:
- false
-
getContentLength
public long getContentLength()A gzip entity requires content length in http headers.- Specified by:
getContentLengthin interfaceorg.apache.http.HttpEntity- Overrides:
getContentLengthin classorg.apache.http.client.entity.GzipCompressingEntity- Returns:
- content length of gzip entity
-