使用阿里巴巴 OSS Java SDK,我只能在 Bucket 中检索最多 100 个对象。如何列出所有对象?
编译组:'com.aliyun.oss',名称:'aliyun-sdk-oss',版本:'3.9.1'
ObjectListing objectListing = ossClient.listObjects(bucketName);
int count = 1;
// Use objectListing.getObjectSummaries to obtain the descriptions of all objects.
for (OSSObjectSummary objectSummary : objectListing.getObjectSummaries()) {
System.out.println(count++ + " - " + objectSummary.getKey() + " " +
"(size = " + objectSummary.getSize() + ")");
}