public class AzureBlobDownload
extends java.lang.Object
Constructor and Description |
---|
AzureBlobDownload(java.lang.String accountName,
java.lang.String accountKey,
java.lang.String containerName)
Implements downloading contents from Azure blob containers with HTTPS as
true by default. |
AzureBlobDownload(java.lang.String accountName,
java.lang.String accountKey,
java.lang.String containerName,
boolean useHttps)
Implements downloading contents from Azure blob containers.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
downloadFile(java.lang.String blobPathFileName,
java.lang.String saveToPath)
Download a file from a given blob path of the container.
|
java.lang.String |
downloadFolder(java.lang.String blobFolderPath,
java.lang.String saveToPath)
Download a blob folder and its contents.
|
java.lang.String |
downloadFolder(java.lang.String blobFolderPath,
java.lang.String saveToPath,
boolean keepBlobName)
Download a blob folder and its contents.
|
public AzureBlobDownload(java.lang.String accountName, java.lang.String accountKey, java.lang.String containerName, boolean useHttps)
accountName
- Account name from your Access Keys.accountKey
- Account key from your Access Keys.containerName
- Container name you want to uploadFromFile or create.useHttps
- true
to use HTTPS to connect to the storage service endpoints;
otherwise, false
. Defaults to true
.public AzureBlobDownload(java.lang.String accountName, java.lang.String accountKey, java.lang.String containerName)
true
by default.accountName
- Account name from your Access Keys.accountKey
- Account key from your Access Keys.containerName
- Container name you want to uploadFromFile or create.public java.lang.String downloadFile(java.lang.String blobPathFileName, java.lang.String saveToPath) throws java.net.URISyntaxException, com.microsoft.azure.storage.StorageException, java.io.IOException
Example:
AzureBlobDownload blobDownload = new AzureBlobDownload("account name", "account key", "container name");
String path = blobDownload.downloadFile("blob/path/fileName.txt, "c:/path/to/folder/", false);
blobPathFileName
- Path to the file name on the container.saveToPath
- Absolute path to a location on your computer.java.net.URISyntaxException
- If an invalid account name is provided.com.microsoft.azure.storage.StorageException
- Storage error.java.io.IOException
- If the file does not exist.public java.lang.String downloadFolder(java.lang.String blobFolderPath, java.lang.String saveToPath) throws java.net.URISyntaxException, com.microsoft.azure.storage.StorageException, java.io.IOException
Example:
AzureBlobDownload blobDownload = new AzureBlobDownload("account name", "account key", "container name");
String path = blobDownload.downloadFile("blob/path/, "c:/path/to/folder/");
blobFolderPath
- Folder path on the container to download.saveToPath
- Absolute path to a location on your computer.java.net.URISyntaxException
- If an invalid account name is provided.com.microsoft.azure.storage.StorageException
- Storage error.java.io.IOException
- If the file does not exist.public java.lang.String downloadFolder(java.lang.String blobFolderPath, java.lang.String saveToPath, boolean keepBlobName) throws java.net.URISyntaxException, com.microsoft.azure.storage.StorageException, java.io.IOException
Example:
AzureBlobDownload blobDownload = new AzureBlobDownload("account name", "account key", "container name");
String path = blobDownload.downloadFile("blob/path/, "c:/path/to/folder/", false);
blobFolderPath
- Folder path on the container to download.saveToPath
- Absolute path to a location on your computer.keepBlobName
- Keep the root name of the folder.java.net.URISyntaxException
- If an invalid account name is provided.com.microsoft.azure.storage.StorageException
- Storage error.java.io.IOException
- If the file does not exist.