Reputation: 71
bucket1
folder1
file1
file2
folder3
file3
folder4
file6
folder2
file4
file5
file 7
file 8
I want to get folder1, folder2, file7 and file8 only. How do i get that? Basically I don't want all recursive folders/files in side a folder or bucket. Not very clear on the working of marker, delimiter and prefix.
I am trying:
bucketName = "bucket1";
prefix = "";
delimiter = "";
marker = "";
ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
.withBucketName(bucketName).withPrefix(prefix)
.withDelimiter(delimiter)
.withMarker(marker)
;
Upvotes: 1
Views: 120
Reputation: 71
I am able to get desired result using prefix = "" and delimiter = "/".
Upvotes: 2
Reputation: 2861
As of my knowledge you cant do this.
Since there is no file and folder architecture here all are treated as object. So you have to iterate over all the objects and you have to make your own logic to get your solution.
Upvotes: 2