2

I need to download CSV file from Azure Storage Account, Are there any ways to download the file(CSV) using java SDK or rest API? what API's need to be used?

DAK
  • 282
  • 1
  • 18
  • https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BasicExample.java#L86 , this link shall help – Tushar Mahajan Jun 18 '20 at 13:44

1 Answers1

1

You can use the Azure Storage SDK for java . To download a file, you just need to use the class CloudBlockBlob which should look like,

// 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);
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396