Applicable Scenario
In Cloud Object Storage (COS), you can create a replica of an object with a simple replication operation. You can replicate an object of up to 5 GB in a single operation. If an object is larger than 5 GB, you should use the multipart upload API. With the copy operation, you can:
- Create a copy of an object.
- Rename an object by copying it and deleting the original one.
- Modify the storage class of an object. You can select the same object key as both the source and target and modify the storage class.
- Modify object metadata. You can select the same object key as both the source and target and modify object metadata.
In the copy operation, the metadata of the source object is inherited by default, while the creation date is subject to the creation date of the target object.
Usage Instructions
Using the REST API
Use REST APIs to initiate an object copy request. For more information, see Put Object Copy documentation.
Using Java SDKs
COS supports AWS Java SDK. See Using AWS S3 SDK to Access COS to access COS, and operate according to the Put Object Copy section in the official documentation of AWS Java SDK 2.20.0.