use of com.microsoft.tooling.msservices.model.storage.BlobDirectory in project azure-tools-for-java by Microsoft.
the class StorageClientSDKManager method getRootDirectory.
@NotNull
public BlobDirectory getRootDirectory(@NotNull String connectionString, @NotNull BlobContainer blobContainer) throws AzureCmdException {
try {
CloudBlobClient client = getCloudBlobClient(connectionString);
CloudBlobContainer container = client.getContainerReference(blobContainer.getName());
CloudBlobDirectory directory = container.getDirectoryReference("");
String uri = directory.getUri() != null ? directory.getUri().toString() : "";
return new BlobDirectory("", uri, blobContainer.getName(), "");
} catch (Throwable t) {
throw new AzureCmdException("Error retrieving the root Blob Directory", t);
}
}
Aggregations