How to upload the folder to azure blob storage using java sdk?

BALAJI N 1 Reputation point
2022-06-14T04:25:49.747+00:00

Hi,

I have a use-case where I need to upload the folder recursively to Azure Blob. Seems there is no api which takes folder as parameter and uploads all the files recursively.

Currently I am preparing the files list and uploading one by one.

Please suggest is there any utility which provides support to upload the folder .

Thanks in advance.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 47,466 Reputation points Microsoft Employee Moderator
    2022-06-14T07:19:36.363+00:00

    @BALAJI N Welcome to Microsoft Q&A Forum , Thank you for posting your query here

    There is no folder concept in Blob storage ( since it's flat structure).

    Java Blob upload sample: https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-java?tabs=powershell%2Cenvironment-variable-windows#upload-blobs-to-a-container

    If its ADLS Gen 2 storage, then you have the concepts of Directory / folder, The sample code for this is here:

    Java sample code upload to folder : https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-directory-file-acl-java#upload-a-file-to-a-directory

    You can convert blob storage to ADLS Gen 2 storage if required.

    https://learn.microsoft.com/en-us/azure/storage/blobs/upgrade-to-data-lake-storage-gen2-how-to?tabs=azure-portal#perform-the-upgrade

    Please let us know if you have any further queries. I’m happy to assist you further.

    ----------

    Please do not forget to 211194-screenshot-2021-12-10-121802.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.