• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. Developer Guide (Android SDK)
  4. Bucket Management
  5. Obtaining a Bucket Location

Obtaining a Bucket Location

You can call ObsClient.getBucketLocation to obtain the location of a bucket. Sample code is as follows:

String endPoint = "yourdomainname";
String ak = "*** Provide your Access Key ***";
String sk = "*** Provide your Secret Key ***";
// Create an instance of ObsClient.
ObsClient obsClient = new ObsClient(ak, sk, endPoint);

String location = obsClient.getBucketLocation("bucketname");
Log.i("GetBucketLocation", "\t:" + location);
// Close obsClient.
obsClient.close();
NOTE:

When creating a bucket, you can specify its location. For details, see Creating a Bucket.