使用S3 AmazonS3Client listObjects preFIX通配符? [英] Use S3 AmazonS3Client listObjects prefix with wildcard?
问题描述
请问AWS S3 AmazonS3Client.listObjects(的http://文档。 aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html )支持通配符? 例如,可以将一个做到以下几点:
ListObjectsRequest listObjectsRequest =新ListObjectsRequest()。
withBucketName(富)。
其中preFIX(* / DT = 2013年3月28日/ *)。
withDelimiter(/);
没有,你不能。事实上, *
是在S3键名有效的字符。例如,像一键 /foo/b*ar/dt=2013-03-28/abc.xml
是有效的。照片
你要么需要根据共同preFIX重新组织你的钥匙或遍历所有。
PS:这取决于你的使用情况,这是可能的,你可以使用<一个href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/ListObjectsRequest.html#withMarker%28java.lang.String%29"相对=nofollow> 标记
。
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
.
这篇关于使用S3 AmazonS3Client listObjects preFIX通配符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!