繁体   English   中英

上传时我想使用 Azure blob 存储方法 uploadFromFile() 覆盖现有的 blob

[英]While uploading i want to overwrite existing blob using Azure blob Storage method uploadFromFile()

我想使用 Azure 的 uploadFromFile(String filePath, boolean overwrite) 方法。 但它没有方法。 在此处输入图像描述

我怎样才能覆盖现有的 blob azure。 高度赞赏的答案。 谢谢

您可以将以下 maven 依赖12.16.0版本用于azure- storage-blob

<dependency> 
<groupId>com.azure</groupId> 
<artifactId>azure-storage-blob</artifactId>   
<version>12.16.0</version>
</dependency>

我们可以使用本文档以下代码中建议的uploadFromFile方法:

    try {
     boolean overwrite = false; 
     client.uploadFromFile(filePath, overwrite);
     System.out.println("Upload from file succeeded"); 
     } catch (UncheckedIOException ex) { 
     System.err.printf("Failed to upload from file %s%n", ex.getMessage());
      }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM