Azure Blob 容器文件下载

Azure Blob Container file download

我需要从 Azure 存储帐户下载 CSV 文件,有什么方法可以使用 java SDK 或 rest API 下载文件 (CSV)?需要使用什么API?

您可以将 Azure Storage SDK 用于 java。要下载文件,您只需要使用 class CloudBlockBlob,它应该看起来像

// Download the blob to a local file
// Append the string "DOWNLOAD" before the .txt extension so that you can see both files.
String downloadFileName = fileName.replace(".txt", "DOWNLOAD.txt");
File downloadedFile = new File(localPath + downloadFileName);

System.out.println("\nDownloading blob to\n\t " + localPath + downloadFileName);

blobClient.downloadToFile(localPath + downloadFileName);