List buckets
Updated at:2025-11-03
List all the user’s buckets using the following code or with reference to Complete Example.
Java
1public void listBuckets (BosClient client) {
2 // Obtain the user's bucket list
3 List<BucketSummary> buckets = client.listBuckets().getBuckets();
4 // Traverse bucket
5 for (BucketSummary bucket : buckets) {
6 System.out.println(bucket.getName());
7 }
8}
