use of com.microsoft.azure.storage.StorageCredentials in project camel by apache.
the class QueueServiceUtil method createQueueClient.
public static CloudQueue createQueueClient(QueueServiceConfiguration cfg) throws Exception {
CloudQueue client = (CloudQueue) getConfiguredClient(cfg);
if (client == null) {
URI uri = prepareStorageQueueUri(cfg);
StorageCredentials creds = getAccountCredentials(cfg);
client = new CloudQueue(uri, creds);
}
return client;
}
use of com.microsoft.azure.storage.StorageCredentials in project camel by apache.
the class BlobServiceUtil method createBlobContainerClient.
public static CloudBlobContainer createBlobContainerClient(BlobServiceConfiguration cfg) throws Exception {
URI uri = prepareStorageBlobUri(cfg, false);
StorageCredentials creds = getAccountCredentials(cfg);
return new CloudBlobContainer(uri, creds);
}
use of com.microsoft.azure.storage.StorageCredentials 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.StorageCredentials in project camel by apache.
the class BlobServiceComponent method checkCredentials.
private void checkCredentials(BlobServiceConfiguration cfg) {
CloudBlob client = cfg.getAzureBlobClient();
StorageCredentials creds = client == null ? cfg.getCredentials() : client.getServiceClient().getCredentials();
if ((creds == null || creds instanceof StorageCredentialsAnonymous) && !cfg.isPublicForRead()) {
throw new IllegalArgumentException("Credentials must be specified.");
}
}
use of com.microsoft.azure.storage.StorageCredentials in project camel by apache.
the class BlobServiceUtil method createAppendBlobClient.
public static CloudAppendBlob createAppendBlobClient(BlobServiceConfiguration cfg) throws Exception {
CloudAppendBlob client = (CloudAppendBlob) getConfiguredClient(cfg);
if (client == null) {
URI uri = prepareStorageBlobUri(cfg);
StorageCredentials creds = getAccountCredentials(cfg);
client = new CloudAppendBlob(uri, creds);
}
return client;
}
Aggregations