IBM SDK for Java Developer Guide
The IBM Cloud Object Storage SDK for Java provides support for interacting with the Object Storage Data API.
To get started with using the IBM Cloud Object Storage SDK for Java, including installation, configuration, and complete SDK API documentation, please refer to the project README found at https://github.com/ibm/ibm-cos-sdk-java
Vault Mode FeaturesIn addition to support of all generally available features, the IBM Cloud Object Storage SDK for Java supports several features which are available only vault mode deployments of IBM Cloud Object Storage.
- Note all code sample assume an instance of the SDK client has been pre-created and assigned to the variable client
The Immutable Object Storage feature supports the use of a Mirror-Destination header for read operations to explicitly choose which side of the mirror to read from, when the feature is deployed in a mirror configuration.
Get Object Request with Mirror-Destination Header
GetObjectRequest request = new GetObjectRequest("bucket", "key");
request.setWormMirrorDestination("vault uuid");
client.getObject(request);
For more information on Immutable Object Storage setup, see: Add protection to a bucket
Object Versioning
The Object Versioning feature allows IBM Cloud Object Storage to retain multiple versions of an object with the same key. Subsequent operations against an object can target a specific version of that object, including for reads and deletes.
Get Object Request with Version-Id Header
GetObjectRequest request = new GetObjectRequest("bucket",
"key",
"version id");
client.getObject(request);
Delete Object Request with Version-Id Header
DeleteVersionRequest request = new DeleteVersionRequest("bucket", "key", "version id");
client.deleteVersion(request);
For more information on Object Versioning setup, see: Set up a bucket for versioning
Bucket Tagging
The Bucket Tagging feature enables users to store arbitrary tag metadata associated with a particular vault. Tags can be retrieved at a later date with a subsequent read operation.
Put Bucket Tagging Request
TagSet tagSet = new TagSet();
tagSet.setTag("myKey", "myValue");
BucketTaggingConfiguration config = new BucketTaggingConfiguration()
.withTagSets(tagSet);
SetBucketTaggingConfigurationRequest request =
new SetBucketTaggingConfigurationRequest("bucket", config);
client.setBucketTaggingConfiguration(request);
Get Bucket Tagging Request
client.getBucketTaggingConfiguration("bucket");
For more information on Bucket Tagging, see: Add tags to a bucket
Unsupported Public Cloud FeaturesWhile most features in the IBM Cloud Object Storage SDK for Java are generally available, some features are available only when used in conjunction with the IBM Public Cloud, and are therefore unsupported in on premise deployments of IBM Cloud Object Storage. These features include:
- IBM Cloud IAM Authentication
- IBM Cloud Key Protect KMS
- Aspera high-speed transfer
- Object Archive
- Extended Bucket Listing