use of com.microsoft.azure.storage.StorageCredentials in project camel by apache.
the class BlobServiceUtil method createBlockBlobClient.
public static CloudBlockBlob createBlockBlobClient(BlobServiceConfiguration cfg) throws Exception {
CloudBlockBlob client = (CloudBlockBlob) getConfiguredClient(cfg);
if (client == null) {
URI uri = prepareStorageBlobUri(cfg);
StorageCredentials creds = getAccountCredentials(cfg);
client = new CloudBlockBlob(uri, creds);
}
return client;
}
use of com.microsoft.azure.storage.StorageCredentials in project camel by apache.
the class BlobServiceUtil method createPageBlobClient.
public static CloudPageBlob createPageBlobClient(BlobServiceConfiguration cfg) throws Exception {
CloudPageBlob client = (CloudPageBlob) getConfiguredClient(cfg);
if (client == null) {
URI uri = prepareStorageBlobUri(cfg);
StorageCredentials creds = getAccountCredentials(cfg);
client = new CloudPageBlob(uri, creds);
}
return client;
}
use of com.microsoft.azure.storage.StorageCredentials in project camel by apache.
the class QueueServiceComponent method checkCredentials.
private void checkCredentials(QueueServiceConfiguration cfg) {
CloudQueue client = cfg.getAzureQueueClient();
StorageCredentials creds = client == null ? cfg.getCredentials() : client.getServiceClient().getCredentials();
if (creds == null) {
throw new IllegalArgumentException("Credentials must be specified.");
}
}
use of com.microsoft.azure.storage.StorageCredentials in project hadoop by apache.
the class AzureNativeFileSystemStore method connectUsingConnectionStringCredentials.
/**
* Connect to Azure storage using account key credentials.
*/
private void connectUsingConnectionStringCredentials(final String accountName, final String containerName, final String accountKey) throws InvalidKeyException, StorageException, IOException, URISyntaxException {
// If the account name is "acc.blob.core.windows.net", then the
// rawAccountName is just "acc"
String rawAccountName = accountName.split("\\.")[0];
StorageCredentials credentials = new StorageCredentialsAccountAndKey(rawAccountName, accountKey);
connectUsingCredentials(accountName, credentials, containerName);
}
use of com.microsoft.azure.storage.StorageCredentials in project hadoop by apache.
the class AzureNativeFileSystemStore method connectUsingSASCredentials.
/**
* Connect to Azure storage using shared access signature credentials.
*/
private void connectUsingSASCredentials(final String accountName, final String containerName, final String sas) throws InvalidKeyException, StorageException, IOException, URISyntaxException {
StorageCredentials credentials = new StorageCredentialsSharedAccessSignature(sas);
connectingUsingSAS = true;
connectUsingCredentials(accountName, credentials, containerName);
}
Aggregations