开发者

List only the first level of files in jets3t

开发者 https://www.devze.com 2023-02-24 05:15 出处:网络
I am using jets3t to list the files on one of our buckets. And I noticed it returns everything. I would like to traverse the bucket by directory instead of it getting it all at once, It would take too

I am using jets3t to list the files on one of our buckets. And I noticed it returns everything. I would like to traverse the bucket by directory instead of it getting it all at once, It would take too long, so I am curious is there a way to only get the files on the first level?

For example:

\Bin

-\file1.txt

-\folder1

----\file2.txt

开发者_开发问答

so basically get the file1.txt and folder1 object but not go deeper and get file2.txt which is in folder1.


http://jets3t.s3.amazonaws.com/api/org/jets3t/service/S3Service.html#listObjects%28java.lang.String,%20java.lang.String,%20java.lang.String%29

the S3Service method above accepts a bucket name as well as a prefix and a delimiter to narrow your return results.

0

精彩评论

暂无评论...
验证码 换一张
取 消