amazon web services - Excluding prefix in ObjectListing results Java client for S3 - Stack Overflow
Use withPrefix
and withMarker
together:
ListObjectsRequest req = new ListObjectsRequest().withBucketName("bucketName").withPrefix("folder1/").withMarker("folder1/");
This works because first you filter withPrefix
and obtain all folder1/* keys, including folder1/, and then with withMarker("folder1/")
you specify to get the keys that are lexicographically after "folder1/" as documented in the javadoc:
The list will only include keys that occur lexicographically after the marker.
Read full article from amazon web services - Excluding prefix in ObjectListing results Java client for S3 - Stack Overflow
No comments:
Post a Comment