Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Added CopyObject example from Scott
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug-AWS committed Nov 13, 2019
1 parent 15b2515 commit 435f1d2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc_source/examples-s3-objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,25 @@ object to delete. *The specified bucket and object key must exist, or the servic
:language: java

See the :sdk-examples-java-s3:`complete example <S3ObjectOperations.java>` on GitHub.

Copy an Object
================

Build a :aws-java-class:`CopyObjectRequest <services/s3/model/CopyObjectRequest>`
and supply a bucket name that the object is coped into, a URL encoded string value, and the key name of the object.
Use the |s3client|'s :methodname:`copyObject` method, and pass the :aws-java-class:`CopyObjectRequest <services/s3/model/CopyObjectRequest>` object.
*The specified bucket and object key must exist, or the service will return an error.*

**Imports**

.. literalinclude:: s3.java2.copy_object.import.txt
:language: java

**Code**

.. literalinclude:: s3.java2.copy_object.main.txt
:dedent: 8
:language: java

See the :sdk-examples-java-s3:`complete example <CopyObject.java>` on GitHub.

0 comments on commit 435f1d2

Please sign in to comment.