How to list all AWS S3 objects in a bucket using Java

后端 未结 11 1301
攒了一身酷
攒了一身酷 2020-11-30 20:34

What is the simplest way to get a list of all items within an S3 bucket using Java?

List s3objects = s3.listObjects(bucketName,prefix)         


        
11条回答
  •  生来不讨喜
    2020-11-30 21:18

    I know this is an old post, but this still might be usefull to anyone: The Java/Android SDK on version 2.1 provides a method called setMaxKeys. Like this:

    s3objects.setMaxKeys(arg0)
    

    You probably found a solution by now, but please check one answer as correct so that it might help others in the future.

提交回复
热议问题