let's say I have blob structure like this:
dir0
├── dir1
│ ├── file11
│ └── file12
├── dir2
└── dir3
After listing the dir1
that contains two files file11
, file12
with listBlobsByHierarchy("dir0/dir1/")
method I'm getting two blobs with blobName
property set to dir0/dir1/file11
and dir0/dir1/file12
, so <virtual_path>
/<file_name>
. That's OK, but in some point I need to get the <file_name>
part.
My question is: Does Azure Storage SDK 12 for Java provides a mechanism for obtaining <file_name>
part from blob name? I could do it myself but it's hard to believe that SDK doesn't provide this functionality... Maybe you guys know different elegant way to do so? How do you usually handle such things?
It's a bit weird to me that SDK seems not to support building prefixes or getting file names from blob names :P I expected sth like fileName
field in BlobItem
class or buildPrefix(List<String> segments)
method for joining path segments with '/'.