我正在使用 Java SDK 连接到 Azure Blob 存储:
@Bean
@SneakyThrows
public CloudBlobContainer sourceContainer(CloudStorageAccount cloudStorageAccount) {
return cloudStorageAccount
.createCloudBlobClient()
.getContainerReference(sourceContainerName);
}
在下载过程中,我正在使用 listBobs 和必要的CloudBlockBlob
.
它存在于 blob 列表中。然后我尝试下载它:
blob.downloadToFile(path);
blob.delete();
它失败并出现错误:
Method threw 'com.microsoft.azure.storage.StorageException' exception.
The specified blob does not exist.
有趣的事实是,当我重命名 blob 以删除法语重音字母时,它按预期工作。但我无法从服务器端解决它。我无法使用没有法语重音字母的文件名复制到 blob,因为每次操作都CloudBlockBlob
失败并出现 404 HTTP 代码