java - S3 ListObjectsV2Request 排序参数

标签 java amazon-web-services amazon-s3

我可以将 bucketName 存储桶中的 maxKeys 项列出为:

new ListObjectsV2Request().withBucketName(bucketName).withMaxKeys(maxKeys)

如果存储桶中的对象多于 maxKeys,我想获取“maxKeys”最旧的对象。

如何获取最旧的 maxKeys 个?有没有办法向我的列表请求添加排序参数?

最佳答案

没有。 ListObjects API 调用没有排序参数。

来自Listing object keys programmatically - Amazon Simple Storage Service :

List results are always returned in UTF-8 binary order.

(引用文献:Does the ListBucket command guarantee the results are sorted by key?)

关于java - S3 ListObjectsV2Request 排序参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66211483/

相关文章:

java - 在一个类中重写多个类的多个方法

java - getExternalFilesDir(null) 抛出 NullPointerException

amazon-web-services - Amazon Elasticsearch和Elastic Cloud(elastic.co)如何比较?

amazon-web-services - 如何在 CloudFormation 中添加带有 S3 触发器的 Lambda 函数?

node.js - 使用 Node Lambda 函数解析 SES 存储在 AWS S3 存储桶中的电子邮件

java - 如何通过单击按钮更改 android studio 中的语言设置。

java - 如何在Vaadin中实现一键上传组件?

azure - 在 Amazon AWS 上部署 Azure Stack

mysql - 通过 SSH 在两个远程主机之间导入/导出 mysql

python - 使用 boto3 的 StreamingBody.iter_lines() 迭代 S3 中的文件是否算作每行的 GET 请求?