Home > Software design >  Delete empty blob directory
Delete empty blob directory

Time:09-13

I want to delete some blob directory using Azure Java SDK (enter image description here

#2 enter image description here

#3

enter image description here

#4 enter image description here

Any ideas how can improve my function?

CodePudding user response:

Considering your Storage Account is ADLS Gen2, you cannot use Blob Storage SDK to delete folders as the folders in your General Purpose Storage accounts are virtual folders (they are simply blob prefixes).

In order to delete the folders, you would want to use SDK specific for ADLS Gen2 accounts. The SDK you would want to use is com.azure:azure-storage-file-datalake.

You can find more details about using the SDK and some code samples here: https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-directory-file-acl-java.

  • Related