Java 使用法语文件名从Azure Blob存储加载文件

Java 使用法语文件名从Azure Blob存储加载文件,java,spring,azure,azure-storage-blobs,french,Java,Spring,Azure,Azure Storage Blobs,French,我正在使用Java SDK连接Azure Blob存储: @Bean @SneakyThrows public CloudBlobContainer sourceContainer(CloudStorageAccount cloudStorageAccount) { return cloudStorageAccount .createCloudBlobClient() .getContainerReference(sourceContain

我正在使用Java SDK连接Azure Blob存储:

@Bean
@SneakyThrows
public CloudBlobContainer sourceContainer(CloudStorageAccount cloudStorageAccount) {
    return cloudStorageAccount
            .createCloudBlobClient()
            .getContainerReference(sourceContainerName);
}
在下载过程中,我将使用ListBob和必要的CloudBlockBlob

它存在于blob列表中。然后我试着下载它:

blob.downloadToFile(path);
blob.delete();
它失败时出错:

Method threw 'com.microsoft.azure.storage.StorageException' exception.
The specified blob does not exist.
有趣的是,当我重命名blob以删除法语重音字母时,它的效果与预期的一样。但我无法从服务器端解决它。我无法复制到没有法语重音字母的文件名的blob,因为CloudBlockBlob上的每个Obeation都会失败,404 HTTP代码我使用azure storage 5.0.0进行测试,它可以下载名为associé.txt的文件。也许你可以试试我的代码或者提供更多的信息让我进行测试

    final String storageConnectionString ="connectionstring";

    CloudStorageAccount account = CloudStorageAccount.parse(storageConnectionString);

    CloudBlobClient serviceClient = account.createCloudBlobClient();

    CloudBlobContainer container = serviceClient.getContainerReference("test");
    container.createIfNotExists();

    File file = new File("E:\\Test");
    for(ListBlobItem item : container.listBlobs()){
        CloudBlockBlob cloudBlob = (CloudBlockBlob) item;
        File f = new File(file.getAbsolutePath() + "\\" +cloudBlob.getName() );
        cloudBlob.downloadToFile(f.toString());
        System.out.println(cloudBlob.getName()+" success download");
    }