Java Code Examples for

The following are Jave code examples for showing how to use listNextBatchOfObjects() of the class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: ooso   File:   Source Code and License Vote up 8 votes
public static List<S3ObjectSummary> getBucketObjectSummaries(String bucket, String prefix) {
    String realBucket = getBucketFromFullPath(bucket);
    String preprefix = getPrefixFromFullPath(bucket);

    AmazonS3 s3Client = AmazonS3Provider.getS3Client();
    ListObjectsRequest req = new ListObjectsRequest().withBucketName(realBucket).withPrefix(!preprefix.equals("") ? preprefix + "/" + prefix : prefix);
    ObjectListing objectListing = s3Client.listObjects(req);
    List<S3ObjectSummary> summaries = objectListing.getObjectSummaries();

    while (objectListing.isTruncated()) {
        objectListing = s3Client.listNextBatchOfObjects(objectListing);

    return -> !obj.getKey().equals("") && !obj.getKey().endsWith("/")).collect(toList());