Class AzureStorageHelper
- java.lang.Object
-
- com.microsoft.azure.toolkit.lib.legacy.function.AzureStorageHelper
-
public class AzureStorageHelper extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private static StringFAIL_TO_DELETE_BLOBprivate static StringFAIL_TO_GENERATE_BLOB_SAS_TOKENprivate static StringFAIL_TO_UPLOAD_BLOBprivate static intSAS_START_RESERVE_MINUTE
-
Constructor Summary
Constructors Constructor Description AzureStorageHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeleteBlob(com.microsoft.azure.storage.CloudStorageAccount storageAccount, String containerName, String blobName)protected static com.microsoft.azure.storage.blob.CloudBlobContainergetBlobContainer(com.microsoft.azure.storage.CloudStorageAccount storageAccount, String containerName)static StringgetSASToken(com.microsoft.azure.storage.blob.CloudBlob blob, java.time.Period period)static com.microsoft.azure.storage.blob.CloudBlockBlobuploadFileAsBlob(File fileToUpload, com.microsoft.azure.storage.CloudStorageAccount storageAccount, String containerName, String blobName, com.microsoft.azure.storage.blob.BlobContainerPublicAccessType accessType)
-
-
-
Field Detail
-
SAS_START_RESERVE_MINUTE
private static final int SAS_START_RESERVE_MINUTE
- See Also:
- Constant Field Values
-
FAIL_TO_DELETE_BLOB
private static final String FAIL_TO_DELETE_BLOB
- See Also:
- Constant Field Values
-
FAIL_TO_UPLOAD_BLOB
private static final String FAIL_TO_UPLOAD_BLOB
- See Also:
- Constant Field Values
-
FAIL_TO_GENERATE_BLOB_SAS_TOKEN
private static final String FAIL_TO_GENERATE_BLOB_SAS_TOKEN
- See Also:
- Constant Field Values
-
-
Method Detail
-
uploadFileAsBlob
public static com.microsoft.azure.storage.blob.CloudBlockBlob uploadFileAsBlob(File fileToUpload, com.microsoft.azure.storage.CloudStorageAccount storageAccount, String containerName, String blobName, com.microsoft.azure.storage.blob.BlobContainerPublicAccessType accessType) throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
- Throws:
com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
-
deleteBlob
public static void deleteBlob(com.microsoft.azure.storage.CloudStorageAccount storageAccount, String containerName, String blobName) throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException- Throws:
com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
-
getSASToken
public static String getSASToken(com.microsoft.azure.storage.blob.CloudBlob blob, java.time.Period period) throws com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
- Throws:
com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException
-
getBlobContainer
protected static com.microsoft.azure.storage.blob.CloudBlobContainer getBlobContainer(com.microsoft.azure.storage.CloudStorageAccount storageAccount, String containerName) throws URISyntaxException, com.microsoft.azure.storage.StorageException- Throws:
URISyntaxExceptioncom.microsoft.azure.storage.StorageException
-
-