Created
July 19, 2013 12:10
-
-
Save fgblanch/6038699 to your computer and use it in GitHub Desktop.
Revisions
-
fgblanch renamed this gist
Jul 19, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
fgblanch created this gist
Jul 19, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ AmazonS3 s3 = new AmazonS3Client(new PropertiesCredentials(MyClass.class.getResourceAsStream("AwsCredentials.properties"))); String s3Key = "folder1/folder2"; String bucketName = Constantes.S3_BUCKET; String key = s3Key +"/input_chopped/"; ObjectListing current = s3.listObjects(new ListObjectsRequest() .withBucketName(bucketName) .withPrefix(key)); boolean siguiente = true; while (siguiente) { siguiente &= current.isTruncated(); contador += current.getObjectSummaries().size(); for (S3ObjectSummary objectSummary : current.getObjectSummaries()) { S3Object object = s3.getObject(new GetObjectRequest(bucketName, objectSummary.getKey())); System.out.println(object.getKey()); } current=s3.listNextBatchOfObjects(current); }