JavaScript is disabled on your browser.
Skip navigation links

AWS SDK for Java 1.x API Reference - 1.12.795

We announced the upcoming end-of-support for AWS SDK for Java (v1). We recommend that you migrate to AWS SDK for Java v2. For dates, additional details, and information on how to migrate, please refer to the linked announcement.
com.amazonaws.http.apache.utils

Class ApacheUtils



  • public class ApacheUtils
    extends Object 
    • Constructor Summary

      Constructors
      Constructor and Description
      ApacheUtils ()
    • Method Summary

      All Methods
      Modifier and Type Method and Description
      static HttpResponse createResponse (Request<?> request, org.apache.http.client.methods.HttpRequestBase method, org.apache.http.HttpResponse apacheHttpResponse, org.apache.http.protocol.HttpContext context)
      Creates and initializes an HttpResponse object suitable to be passed to an HTTP response handler object.
      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 boolean isRequestSuccessful (org.apache.http.HttpResponse response)
      Checks if the request was successful or not based on the status code.
      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 newClientContext (HttpClientSettings settings, Map<String,? extends Object> attributes)
      Returns a new HttpClientContext used for request execution.
      static org.apache.http.client.CredentialsProvider newProxyCredentialsProvider (HttpClientSettings settings)
      Returns a new Credentials Provider for use with proxy authentication.
      static org.apache.http.HttpEntity newStringEntity (String s)
      Utility function for creating a new StringEntity and wrapping any errors as a SdkClientException.
    • Constructor Detail

      • ApacheUtils

        public ApacheUtils()
    • Method Detail

      • isRequestSuccessful

        public static boolean isRequestSuccessful(org.apache.http.HttpResponse response)
        Checks if the request was successful or not based on the status code.
        Parameters:
        response - HTTP response
        Returns:
        True if the request was successful (i.e. has a 2xx status code), false otherwise.
      • createResponse

        public static HttpResponse createResponse(Request<?> request,
         org.apache.http.client.methods.HttpRequestBase method,
         org.apache.http.HttpResponse apacheHttpResponse,
         org.apache.http.protocol.HttpContext context)
         throws IOException 
        Creates and initializes an HttpResponse object suitable to be passed to an HTTP response handler object.
        Parameters:
        request - Marshalled request object.
        method - The HTTP method that was invoked to get the response.
        context - The HTTP context associated with the request and response.
        Returns:
        The new, initialized HttpResponse object ready to be passed to an HTTP response handler object.
        Throws:
        IOException - If there were any problems getting any response information from the HttpClient method object.
      • newStringEntity

        public static org.apache.http.HttpEntity newStringEntity(String s)
        Utility function for creating a new StringEntity and wrapping any errors as a SdkClientException.
        Parameters:
        s - The string contents of the returned HTTP entity.
        Returns:
        A new StringEntity with the specified contents.
      • newBufferedHttpEntity

        public static org.apache.http.HttpEntity newBufferedHttpEntity(org.apache.http.HttpEntity entity)
         throws FakeIOException 
        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.
        Throws:
        FakeIOException - only for test simulation
      • newClientContext

        public static org.apache.http.client.protocol.HttpClientContext newClientContext(HttpClientSettings settings,
         Map<String,? extends Object> attributes)
        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(HttpClientSettings settings)
        Returns a new Credentials Provider for use with proxy authentication.
Skip navigation links

AltStyle によって変換されたページ (->オリジナル) /