java.lang.Object
software.amazon.awssdk.http.apache.internal.utils.ApacheUtils

public final class ApacheUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    disableNormalizeUri(org.apache.http.client.config.RequestConfig.Builder requestConfigBuilder)
    From Apache v4.5.8, normalization should be disabled or AWS requests with special characters in URI path will fail with Signature Errors.
    static org.apache.http.HttpEntity
    newBufferedHttpEntity(org.apache.http.HttpEntity entity)
    Utility function for creating a new BufferedEntity and wrapping any errors as a SdkClientException.
    static org.apache.http.client.protocol.HttpClientContext
    Returns a new HttpClientContext used for request execution.
    static org.apache.http.client.CredentialsProvider
    Returns a new Credentials Provider for use with proxy authentication.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • newBufferedHttpEntity

      public static org.apache.http.HttpEntity newBufferedHttpEntity(org.apache.http.HttpEntity entity)
      Utility function for creating a new BufferedEntity and wrapping any errors as a SdkClientException.
      Parameters:
      entity - The HTTP entity to wrap with a buffered HTTP entity.
      Returns:
      A new BufferedHttpEntity wrapping the specified entity.
    • newClientContext

      public static org.apache.http.client.protocol.HttpClientContext newClientContext(ProxyConfiguration proxyConfiguration)
      Returns a new HttpClientContext used for request execution.
    • disableNormalizeUri

      public static void disableNormalizeUri(org.apache.http.client.config.RequestConfig.Builder requestConfigBuilder)
      From Apache v4.5.8, normalization should be disabled or AWS requests with special characters in URI path will fail with Signature Errors.

      setNormalizeUri is added only in 4.5.8, so customers using the latest version of SDK with old versions (4.5.6 or less) of Apache httpclient will see NoSuchMethodError. Hence this method will suppress the error. Do not use Apache version 4.5.7 as it breaks URI paths with special characters and there is no option to disable normalization.

      For more information, See https://github.com/aws/aws-sdk-java/issues/1919
    • newProxyCredentialsProvider

      public static org.apache.http.client.CredentialsProvider newProxyCredentialsProvider(ProxyConfiguration proxyConfiguration)
      Returns a new Credentials Provider for use with proxy authentication.