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("/");
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With