BucketUtils (AWS SDK for Java

BucketUtils (AWS SDK for Java - 2.25.21)
public final class BucketUtilsextends Object

Utilities for working with Amazon S3 bucket names, such as validation and checked to see if they are compatible with DNS addressing.

  • Method Summary

    static boolean

    Validates that the specified bucket name is valid for Amazon S3 V2 naming (i.e.

    static boolean

    Validates if the given bucket name follows naming guidelines that are acceptable for using virtual host style addressing.

  • Method Details

    • isValidDnsBucketName

      public static boolean isValidDnsBucketName(String bucketName, boolean throwOnError)
      Parameters:
      bucketName - The bucket name to validate.
      Throws:
      IllegalArgumentException - If the specified bucket name doesn't follow Amazon S3's guidelines.
    • isVirtualAddressingCompatibleBucketName

      public static boolean isVirtualAddressingCompatibleBucketName(String bucketName, boolean throwOnError)

      Validates if the given bucket name follows naming guidelines that are acceptable for using virtual host style addressing.

      Parameters:
      bucketName - The bucket name to validate.
      throwOnError - boolean to decide if an error should be thrown if the bucket name doesn't follow the naming convention

You Might Also Like