我有一个包含许多容器的 Azure Blob。每个容器都有多个文件夹 - 每个文件夹中都有一堆文件。我希望能够获取所有文件并将它们压缩返回。我目前一次只能获取一个文件...
public void downloadAllFromBlob(String containerName){
CloudBlobClient blobClient = this.storageAccount.createCloudBlobClient();
try{
CloudBlobContainer container = blobClient.getContainerReference(containerName);
if(container.exists()){
// I want to grab all the files in the container and zip them
for(ListBlobItem blobItem: container.listBlobs()){
// i'm only able to list/VIEW the blobs, and not go into one and get all the contents
}
}
}catch(){
}
}
最佳答案
遗憾的是,Azure Blob 存储中不提供批量检索功能。您需要单独下载每个 blob,如上面所示。您可以尝试并行检索 blob 以加快速度。
关于java - 如何从 Azure Blob 获取所有文件并压缩它们?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63368867/