• Object Storage Service

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

Obtaining a Versioning Object

You can call ObsClient.getObject to pass the version ID (versionId) to obtain a versioning object. 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);

// Set versionId to obtain a versioning object.
ObsObject obsObject = obsClient.getObject("bucketname", "objectkey", "versionid");

// Close obsClient.

If version ID is null, the object of the latest version will be downloaded, by default.