Skip to content

CopyObject in SDK V2- how to specify the copy version #1656

@damogallagher

Description

@damogallagher

Expected 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions