百度智能云

All Product Document

          Object Storage

          View Bucket List

          Basic Introduction

          After creating a bucket, you can view a list of all buckets you own.

          Operation Method

          BOS supports listing the bucket through the console, SDK, and API, as shown below:

          Example

          Below are the example codes for Java SDK:

          public void listbuckets (BosClient client) { 
              // Get the user's bucket list. 
              List<BucketSummary> buckets = client.listBuckets().getBuckets(); 
              // Traverse all buckets. 
              for (BucketSummary bucket : buckets) { 
                  System.out.println(bucket.getName()); 
              } 
          } 
          Previous
          Set Cross-Origin Resource Sharing (CORS)
          Next
          Set Access Log