Class AzureStorageValidator
java.lang.Object
org.eclipse.edc.azure.blob.validator.AzureStorageValidator
Validates storage account resource names and keys.
See Azure documentation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvalidateAccountName(String accountName) Checks if an account name is valid.static voidvalidateBlobName(String blobName) Checks if a blob name is valid.static voidvalidateBlobPrefix(String blobPrefix) Checks if a blob prefix is valid.static voidvalidateContainerName(String containerName) Checks if a container name is valid.static voidvalidateKeyName(String keyName) Checks if key name is valid.static voidvalidateMetadata(String metadata) Checks if a metadata value is valid.
-
Constructor Details
-
AzureStorageValidator
public AzureStorageValidator()
-
-
Method Details
-
validateAccountName
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
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
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
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
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
Checks if key name is valid.- Parameters:
keyName- A string representing blob key secret.- Throws:
IllegalArgumentException- if the string is null or blank.
-