Class AzureUtils
- java.lang.Object
-
- com.microsoftopentechnologies.windowsazurestorage.helper.AzureUtils
-
public final class AzureUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
generateBlobSASURL(StorageAccountInfo storageAccount, String containerName, String blobName, com.azure.storage.blob.sas.BlobSasPermission permissions)
static String
generateFileSASURL(StorageAccountInfo storageAccount, String shareName, String fileName, com.azure.storage.file.share.sas.ShareFileSasPermission permissions)
Generates SAS URL for file item in Azure storage File Share.static com.azure.storage.blob.BlobContainerClient
getBlobContainerReference(StorageAccountInfo storageAccount, String containerName, boolean createIfNotExist, boolean allowRetry, Boolean cntPubAccess)
static com.azure.storage.blob.BlobServiceClient
getCloudStorageAccount(StorageAccountInfo storageAccount)
static com.azure.storage.blob.BlobServiceClient
getCloudStorageAccount(StorageAccountInfo storageAccount, com.azure.storage.common.policy.RequestRetryOptions retryOptions)
static com.azure.storage.file.share.ShareServiceClient
getShareClient(StorageAccountInfo storageAccount)
static boolean
validateStorageAccount(StorageAccountInfo storageAccount, boolean allowRetry)
This method validates Storage Account credentials by checking for a dummy container existence.
-
-
-
Method Detail
-
validateStorageAccount
public static boolean validateStorageAccount(StorageAccountInfo storageAccount, boolean allowRetry) throws WAStorageException
This method validates Storage Account credentials by checking for a dummy container existence.- Parameters:
storageAccount
-- Returns:
- true if valid
- Throws:
WAStorageException
-
getCloudStorageAccount
public static com.azure.storage.blob.BlobServiceClient getCloudStorageAccount(StorageAccountInfo storageAccount)
-
getShareClient
public static com.azure.storage.file.share.ShareServiceClient getShareClient(StorageAccountInfo storageAccount) throws MalformedURLException, URISyntaxException
-
getCloudStorageAccount
public static com.azure.storage.blob.BlobServiceClient getCloudStorageAccount(StorageAccountInfo storageAccount, com.azure.storage.common.policy.RequestRetryOptions retryOptions)
-
getBlobContainerReference
public static com.azure.storage.blob.BlobContainerClient getBlobContainerReference(StorageAccountInfo storageAccount, String containerName, boolean createIfNotExist, boolean allowRetry, Boolean cntPubAccess) throws URISyntaxException, IOException
- Throws:
URISyntaxException
IOException
-
generateBlobSASURL
public static String generateBlobSASURL(StorageAccountInfo storageAccount, String containerName, String blobName, com.azure.storage.blob.sas.BlobSasPermission permissions)
-
generateFileSASURL
public static String generateFileSASURL(StorageAccountInfo storageAccount, String shareName, String fileName, com.azure.storage.file.share.sas.ShareFileSasPermission permissions) throws MalformedURLException, URISyntaxException
Generates SAS URL for file item in Azure storage File Share.- Parameters:
storageAccount
-fileName
-shareName
- container name- Returns:
- SAS URL
- Throws:
MalformedURLException
URISyntaxException
-
-