List objects


Example: Listing Buckets using the s3Client.listObjects() method

AmazonS3 s3Client = new AmazonS3Client();
s3Client.setEndpoint(`https://systemname.example.com`);

ObjectListing listing = s3Client.listObjects(`sample`); 1
List<S3ObjectSummary> summaries = listing.getObjectSummaries(); 2

for (S3ObjectSummary obj : summaries){ 3
  System.out.println(`found: `+obj.getKey()); 4
}

1 Get the list of Objects in the sample Bucket.
2 Create a list of Object Summaries.
3 For each Object…
4 Display `found: ` then the name of the Object.