Obtaining Object Properties

If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference

You can call ObsClient.getObjectMetadata to obtain properties of an object, including the length, MIME type, customized metadata. Sample code is as follows:

String endPoint = "https://your-endpoint";
String ak = "*** Provide your Access Key ***";
String sk = "*** Provide your Secret Key ***";

// Create an instance of ObsClient.
final ObsClient obsClient = new ObsClient(ak, sk, endPoint);

ObjectMetadata metadata = obsClient.getObjectMetadata("bucketname", "objectname");
Log.i("GetObjectMetadata","\t" + metadata.getContentType());
Log.i("GetObjectMetadata","\t" + metadata.getContentLength());
Log.i("GetObjectMetadata","\t" + metadata.getUserMetadata("property"));