• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. Developer Guide (Java SDK)
  4. Versioning Management
  5. Viewing Versioning Status of a Bucket

Viewing Versioning Status of a Bucket

You can call ObsClient.getBucketVersioning to view the versioning status 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);

BucketVersioningConfiguration status = obsClient.getBucketVersioning("bucketname");
System.out.println("\t" + status.getVersioningStatus());

// Close obsClient. 
obsClient.close();