CopyObject in SDK V2- how to specify the copy version
See original GitHub issueExpected Behavior
In version 1 of the sdk - you could specify the following code to perform a copy on a particular version of a file
CopyObjectRequest copyObjectRequest =new CopyObjectRequest(fromBucketName, fromObjectKey, toBucketName, toObjectKey).withSourceVersionId(versionId);
s3Client.copyObject(copyObjectRequest);
Current Behavior
I cant seem to figure out with version 2 of the SDK how to specify the version when performing a copy
Possible Solution
Is it possible to specify a version on the copyObject command? If so could the documentation be updated with the correct syntax to use
Your Environment
- AWS Java SDK version used: 2.10.65
- JDK version used: Amazon 11 Corretto
- Operating System and version: Mac OS Catalina 10.15.3
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
CopyObject - Amazon Simple Storage Service
For more information, see Copy Object Using the REST Multipart Upload API. ... If you don't specify a version ID, Amazon S3 copies...
Read more >AWS Java SDK 2 S3 copy object - Stack Overflow
In the version 2 SDK, the Builder for CopyObjectRequest does not have a clear way to set the source vs destination. There is...
Read more >Copy an object from one Amazon S3 bucket to another using ...
The following code examples show how to copy an S3 object from one bucket to ... For API details, see CopyObject in Amazon...
Read more >CopyObjectRequest (AWS SDK for Java - 2.18.34)
If you don't specify a version ID, Amazon S3 copies the latest version of the source object. Returns: Specifies the source object for...
Read more >How to Copy or Move Objects from one S3 bucket to another ...
Using the AWS S3 CLI Tool. So here are the ingredients for this recipe again as discussed in part 1: 2 - S3...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Bennett-Lynch Yes this looks easy to use. Thanks for following up with me on this item
Hi @damogallagher. Please take a look at the new copy source support introduced by https://github.com/aws/aws-sdk-java-v2/pull/2612 and let me know if this helps satisfy your use case.