use of com.microsoft.azure.storage.StorageCredentialsAccountAndKey in project hadoop by apache.
the class LocalSASKeyGeneratorImpl method getStorageAccountInstance.
/**
* Helper method that creates CloudStorageAccount Instance using the
* storage account key.
* @param accountName Name of the storage account
* @param accountKey Storage Account key
* @return CloudStorageAccount instance for the storage account.
* @throws SASKeyGenerationException
*/
private CloudStorageAccount getStorageAccountInstance(String accountName, String accountKey) throws SASKeyGenerationException {
if (!storageAccountMap.containsKey(accountName)) {
CloudStorageAccount account = null;
try {
account = new CloudStorageAccount(new StorageCredentialsAccountAndKey(accountName, accountKey));
} catch (URISyntaxException uriSyntaxEx) {
throw new SASKeyGenerationException("Encountered URISyntaxException " + "for account " + accountName, uriSyntaxEx);
}
storageAccountMap.put(accountName, account);
}
return storageAccountMap.get(accountName);
}
Aggregations