use of com.microsoft.azure.storage.StorageCredentialsAccountAndKey in project camel by apache.
the class BlobServiceAppendConsumerTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry registry = super.createRegistry();
registry.bind("creds", new StorageCredentialsAccountAndKey("camelazure", "base64EncodedValue"));
return registry;
}
use of com.microsoft.azure.storage.StorageCredentialsAccountAndKey in project camel by apache.
the class BlobServiceBlockConsumerTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry registry = super.createRegistry();
registry.bind("creds", new StorageCredentialsAccountAndKey("camelazure", "base64EncodedValue"));
return registry;
}
use of com.microsoft.azure.storage.StorageCredentialsAccountAndKey in project camel by apache.
the class BlobServiceUtilTest method registerCredentials.
private void registerCredentials() {
StorageCredentials creds = new StorageCredentialsAccountAndKey("camelazure", Base64.encode("key".getBytes()));
JndiRegistry registry = (JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry();
registry.bind("creds", creds);
}
use of com.microsoft.azure.storage.StorageCredentialsAccountAndKey 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.StorageCredentialsAccountAndKey in project hadoop by apache.
the class AzureNativeFileSystemStore method connectUsingCredentials.
private void connectUsingCredentials(String accountName, StorageCredentials credentials, String containerName) throws URISyntaxException, StorageException, AzureException {
URI blobEndPoint;
if (isStorageEmulatorAccount(accountName)) {
isStorageEmulator = true;
CloudStorageAccount account = CloudStorageAccount.getDevelopmentStorageAccount();
storageInteractionLayer.createBlobClient(account);
} else {
blobEndPoint = new URI(getHTTPScheme() + "://" + accountName);
storageInteractionLayer.createBlobClient(blobEndPoint, credentials);
}
suppressRetryPolicyInClientIfNeeded();
// Capture the container reference for debugging purposes.
container = storageInteractionLayer.getContainerReference(containerName);
rootDirectory = container.getDirectoryReference("");
// Can only create container if using account key credentials
canCreateOrModifyContainer = credentials instanceof StorageCredentialsAccountAndKey;
// Configure Azure storage session.
configureAzureStorageSession();
}
Aggregations