Muh*_*mad 3 java azure azure-blob-storage
我已将文件上传到 azure blob 容器上,但如何使用 java 获取上传文件的 url。我有天蓝色门户的连接字符串。
谁能帮我?
这里我使用Azure Blob存储v12,您可以参考下面的代码。有关此 SDK 的更多信息,您可以查看此源代码:适用于 Java 的 Azure Storage Blob 客户端库。
String connectStr = "storage account connection";
// Create a BlobServiceClient object which will be used to create a container client
BlobServiceClient blobServiceClient = new BlobServiceClientBuilder().connectionString(connectStr).buildClient();
BlobContainerClient containerClient = blobServiceClient.getBlobContainerClient("container name");
BlobClient blobClient=containerClient.getBlobClient("blob name");
System.out.println(blobClient.getBlobUrl());
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5448 次 |
| 最近记录: |