Class AzureStorageValidator

java.lang.Object
org.eclipse.edc.azure.blob.validator.AzureStorageValidator

public class AzureStorageValidator extends Object
Validates storage account resource names and keys.

See Azure documentation.

  • Constructor Details

    • AzureStorageValidator

      public AzureStorageValidator()
  • Method Details

    • validateAccountName

      public static void validateAccountName(String accountName)
      Checks if an account name is valid.
      Parameters:
      accountName - A String representing the account name to validate.
      Throws:
      IllegalArgumentException - if the string does not represent a valid account name.
    • validateContainerName

      public static void validateContainerName(String containerName)
      Checks if a container name is valid.
      Parameters:
      containerName - A String representing the container name to validate.
      Throws:
      IllegalArgumentException - if the string does not represent a valid container name.
    • validateBlobName

      public static void validateBlobName(String blobName)
      Checks if a blob name is valid.
      Parameters:
      blobName - A String representing the blob name to validate.
      Throws:
      IllegalArgumentException - if the string does not represent a valid blob name.
    • validateBlobPrefix

      public static void validateBlobPrefix(String blobPrefix)
      Checks if a blob prefix is valid. The restriction is based on Azure Blob Storage folder 'virtualization' which is base on the forward slash (/) used in the blob path as delimiter. Prefix has to ends with '/'.
      Parameters:
      blobPrefix - A String representing the blob prefix to validate.
      Throws:
      IllegalArgumentException - if the string does not represent a valid prefix name.
    • validateMetadata

      public static void validateMetadata(String metadata)
      Checks if a metadata value is valid. The restriction is based on allowed characters for HTTP header values. As there is no length restriction per header field, a reasonable restriction of 4096 character is assumed to leave some space, considering an overall length restriction for HTTP headers of approximately 8KB.
      Parameters:
      metadata - A String representing the metadata value to validate.
      Throws:
      IllegalArgumentException - if the string does not represent a valid metadata value.
    • validateKeyName

      public static void validateKeyName(String keyName)
      Checks if key name is valid.
      Parameters:
      keyName - A string representing blob key secret.
      Throws:
      IllegalArgumentException - if the string is null or blank.