java.lang.Object
software.amazon.awssdk.services.s3.internal.endpoints.S3EndpointUtils

public final class S3EndpointUtils extends Object
Utilities for working with Amazon S3 bucket names and endpoints.
  • Method Details

    • removeFipsIfNeeded

      public static String removeFipsIfNeeded(String region)
    • isFipsRegion

      public static boolean isFipsRegion(String region)
    • isAccelerateEnabled

      public static boolean isAccelerateEnabled(S3Configuration serviceConfiguration)
      Returns:
      True if accelerate mode is enabled per S3Configuration, false if not.
    • isAccelerateSupported

      public static boolean isAccelerateSupported(SdkRequest originalRequest)
      Parameters:
      originalRequest - Request object to identify the operation.
      Returns:
      True if accelerate is supported for the given operation, false if not.
    • accelerateEndpoint

      public static URI accelerateEndpoint(String domain, String protocol)
      Returns:
      The endpoint for an S3 accelerate enabled operation. S3 accelerate has a single global endpoint.
    • accelerateDualstackEndpoint

      public static URI accelerateDualstackEndpoint(String domain, String protocol)
      Returns:
      The endpoint for an S3 accelerate enabled operation. S3 accelerate has a single global endpoint.
    • isDualstackEnabled

      public static boolean isDualstackEnabled(S3Configuration serviceConfiguration)
      Returns:
      True if dualstack is enabled per S3Configuration, false if not.
    • dualstackEndpoint

      public static URI dualstackEndpoint(String id, String domain, String protocol)
      Returns:
      dual stack endpoint from given protocol and region metadata
    • fipsEndpoint

      public static URI fipsEndpoint(String id, String domain, String protocol)
      Returns:
      fips endpoint from given protocol and region metadata
    • fipsDualstackEndpoint

      public static URI fipsDualstackEndpoint(String id, String domain, String protocol)
      Returns:
      dual stack + fips endpoint from given protocol and region metadata
    • isPathStyleAccessEnabled

      public static boolean isPathStyleAccessEnabled(S3Configuration serviceConfiguration)
      Returns:
      True if path style access is enabled per S3Configuration, false if not.
    • isArnRegionEnabled

      public static boolean isArnRegionEnabled(S3Configuration serviceConfiguration)
    • changeToDnsEndpoint

      public static void changeToDnsEndpoint(SdkHttpRequest.Builder mutableRequest, String bucketName)
      Changes from path style addressing (which the marshallers produce by default, to DNS style or virtual style addressing where the bucket name is prepended to the host. DNS style addressing is preferred due to the better load balancing qualities it provides, path style is an option mainly for proxy based situations and alternative S3 implementations.
      Parameters:
      mutableRequest - Marshalled HTTP request we are modifying.
      bucketName - Bucket name for this particular operation.
    • isArn

      public static boolean isArn(String s)