Reputation: 101
Does the AWS S3 AmazonS3Client.listObjects (http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html) support wildcard? for example, can one do the following:
ListObjectsRequest listObjectsRequest = new ListObjectsRequest().
withBucketName("foo").
withPrefix("*/dt=2013-03-28/*").
withDelimiter("/");
Upvotes: 8
Views: 19704
Reputation: 9318
No, you cannot. In fact, *
is a valid character in a key name in S3. For example, a key like /foo/b*ar/dt=2013-03-28/abc.xml
is valid.
You will either need to reorganize your keys according to a common prefix or iterate over them all.
PS: depending on your use case, it is possible that you can use a marker
.
Upvotes: 7