Created
March 7, 2015 04:41
-
-
Save watchamcb/5d1c92b3acb56a34b9ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AmazonS3 s3client = new AmazonS3Client(new ProfileCredentialsProvider()); | |
ListObjectsRequest listObjectsRequest = new ListObjectsRequest() | |
.withBucketName(bucketName) | |
.withPrefix("bob") | |
.withEncodingType("url"); | |
ObjectListing objectListing; | |
do { | |
objectListing = s3client.listObjects(listObjectsRequest); | |
for (S3ObjectSummary objectSummary : | |
objectListing.getObjectSummaries()) { | |
System.out.println( " - " + objectSummary.getKey() + " " + | |
"(size = " + objectSummary.getSize() + ")"); | |
} | |
listObjectsRequest.setMarker(objectListing.getNextMarker()); | |
} while (objectListing.isTruncated()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment