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().
  • Constructor Details

    • ContentCompressingEntity

      public ContentCompressingEntity(org.apache.http.HttpEntity entity)
      Creates a RestClient.ContentCompressingEntity instance with the provided HTTP entity.
      Parameters:
      entity - the HTTP entity.
    • ContentCompressingEntity

      public ContentCompressingEntity(org.apache.http.HttpEntity entity, boolean chunkedEnabled)
      Creates a RestClient.ContentCompressingEntity instance with the provided HTTP entity.
      Parameters:
      entity - the HTTP entity.
      chunkedEnabled - force enable/disable chunked transfer-encoding.
  • Method Details

    • getContent

      public InputStream getContent() throws IOException
      Specified by:
      getContent in interface org.apache.http.HttpEntity
      Overrides:
      getContent in class org.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:
      isChunked in interface org.apache.http.HttpEntity
      Overrides:
      isChunked in class org.apache.http.client.entity.GzipCompressingEntity
      Returns:
      false
    • getContentLength

      public long getContentLength()
      A gzip entity requires content length in http headers.
      Specified by:
      getContentLength in interface org.apache.http.HttpEntity
      Overrides:
      getContentLength in class org.apache.http.client.entity.GzipCompressingEntity
      Returns:
      content length of gzip entity