public class CopyObjectRequest extends AmazonWebServiceRequest implements SSEAwsKeyManagementParamsProvider, Serializable, S3AccelerateUnsupported, ExpectedBucketOwnerRequest, ExpectedSourceBucketOwnerRequest
Provides options for copying an Amazon S3 object from a source location to a new destination.
All CopyObjectRequests
must specify a source bucket and key, along with a destination
bucket and key. Beyond that, requests also specify:
CannedAccessControlList
for the new object,NOOP
Constructor and Description |
---|
CopyObjectRequest()
Constructs a new
CopyObjectRequest object. |
CopyObjectRequest(String sourceBucketName,
String sourceKey,
String destinationBucketName,
String destinationKey)
Constructs with basic options.
|
CopyObjectRequest(String sourceBucketName,
String sourceKey,
String sourceVersionId,
String destinationBucketName,
String destinationKey)
Constructs a new
CopyObjectRequest with basic options, providing
an S3 version ID identifying the specific version of the source object
to copy. |
Modifier and Type | Method and Description |
---|---|
AccessControlList |
getAccessControlList()
Returns the optional access control list for the new object.
|
Boolean |
getBucketKeyEnabled()
Returns whether or not bucket key encryption is used
|
CannedAccessControlList |
getCannedAccessControlList()
Gets the canned ACL to use for the new, copied object.
|
String |
getDestinationBucketName()
The name of the destination bucket.
|
String |
getDestinationKey()
Gets the destination bucket key under which the new, copied
object will be stored.
|
SSECustomerKey |
getDestinationSSECustomerKey()
Returns the optional customer-provided server-side encryption key to use
to encrypt the destination object being copied.
|
String |
getExpectedBucketOwner()
This value represents the expected account id of the destination Amazon S3 bucket owner.
|
String |
getExpectedSourceBucketOwner()
This value represents the expected account id of the source Amazon S3 bucket owner.
|
List<String> |
getMatchingETagConstraints()
Gets the optional list of ETag constraints that, when present, must
include a match for the source object's current ETag in order for the
copy object request to be executed.
|
String |
getMetadataDirective()
Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.
|
Date |
getModifiedSinceConstraint()
Gets the optional modified constraint that restricts this
request to executing only if the source object has been
modified after the specified date.
|
ObjectMetadata |
getNewObjectMetadata()
Gets the optional object metadata to set for the new, copied object.
|
ObjectTagging |
getNewObjectTagging() |
List<String> |
getNonmatchingETagConstraints()
Gets the optional list of ETag constraints that, when present, must
not include a match for the source object's current ETag in order for
the copy object request to be executed.
|
String |
getObjectLockLegalHoldStatus()
Specifies whether you want to apply a Legal Hold to the copied object.
|
String |
getObjectLockMode()
The Object Lock mode that you want to apply to the copied object.
|
Date |
getObjectLockRetainUntilDate()
The date and time when you want this object's Object Lock to expire.
|
String |
getRedirectLocation()
Gets the optional redirect location for the newly copied object.
|
String |
getSourceBucketName()
Gets the name of the bucket containing the source object to be copied.
|
String |
getSourceKey()
Gets the source bucket key under which the source object to be
copied is stored.
|
SSECustomerKey |
getSourceSSECustomerKey()
Returns the optional customer-provided server-side encryption key to use
to decrypt the source object being copied.
|
String |
getSourceVersionId()
Gets the version ID specifying which version of the source
object to copy.
|
SSEAwsKeyManagementParams |
getSSEAwsKeyManagementParams()
Returns the Amazon Web Services Key Management System parameters used to encrypt the
object on server side.
|
String |
getStorageClass()
By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects.
|
Date |
getUnmodifiedSinceConstraint()
Gets the optional unmodified constraint that restricts this
request to executing only if the source object has not been
modified after the specified date.
|
boolean |
isRequesterPays()
Returns true if the user has enabled Requester Pays option when
conducting this operation from Requester Pays Bucket; else false.
|
void |
setAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new object.
|
void |
setBucketKeyEnabled(Boolean bucketKeyEnabled)
Specifies whether the client should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS
(SSE-KMS).
|
void |
setCannedAccessControlList(CannedAccessControlList cannedACL)
Sets the canned ACL to use for the newly copied object.
|
void |
setDestinationBucketName(String destinationBucketName)
Sets the destination bucket name which will contain the new,
copied object.
|
void |
setDestinationKey(String destinationKey)
Sets the destination bucket key under which the new, copied object
will be stored.
|
void |
setDestinationSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to
encrypt the destination object being copied.
|
void |
setExpectedBucketOwner(String expectedBucketOwner)
This value represents the expected account id of the destination Amazon S3 bucket owner.
|
void |
setExpectedSourceBucketOwner(String expectedSourceBucketOwner)
This value represents the expected account id of the source Amazon S3 bucket owner.
|
void |
setMatchingETagConstraints(List<String> eTagList)
Sets the optional list of ETag constraints that, when present, must
include a match for the source object's current ETag in order for the
copy object request to be executed.
|
void |
setMetadataDirective(String metadataDirective)
Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.
|
void |
setModifiedSinceConstraint(Date date)
Sets the optional modified constraint that restricts this request
to executing only if the source object has been modified
after the specified date.
|
void |
setNewObjectMetadata(ObjectMetadata newObjectMetadata)
Sets the object metadata to use for the new, copied object.
|
void |
setNewObjectTagging(ObjectTagging newObjectTagging)
set the tagging for the new object.
|
void |
setNonmatchingETagConstraints(List<String> eTagList)
Sets the optional list of ETag constraints that, when present, must
not include a match for the source object's current ETag in order for
the copy object request to be executed.
|
void |
setObjectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus)
Specifies whether you want to apply a Legal Hold to the copied object.
|
void |
setObjectLockLegalHoldStatus(String objectLockLegalHoldStatus)
Specifies whether you want to apply a Legal Hold to the copied object.
|
void |
setObjectLockMode(ObjectLockMode objectLockMode)
The Object Lock mode that you want to apply to the copied object.
|
void |
setObjectLockMode(String objectLockMode)
The Object Lock mode that you want to apply to the copied object.
|
void |
setObjectLockRetainUntilDate(Date objectLockRetainUntilDate)
The date and time when you want this object's Object Lock to expire.
|
void |
setRedirectLocation(String redirectLocation)
Sets the optional redirect location for the newly copied object.
|
void |
setRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
void |
setSourceBucketName(String sourceBucketName)
Sets the name of the bucket containing the source object to be copied.
|
void |
setSourceKey(String sourceKey)
Sets the source bucket key under which the source object to be
copied is stored.
|
void |
setSourceSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to
decrypt the source object being copied.
|
void |
setSourceVersionId(String sourceVersionId)
Sets the optional version ID specifying which version of the source
object to copy.
|
void |
setSSEAwsKeyManagementParams(SSEAwsKeyManagementParams params)
Sets the Amazon Web Services Key Management System parameters used to encrypt the object
on server side.
|
void |
setStorageClass(StorageClass storageClass)
Sets the optional Amazon S3 storage class to use when storing the newly
copied object.
|
void |
setStorageClass(String storageClass)
Sets the optional Amazon S3 storage class to use when storing the newly
copied object.
|
void |
setUnmodifiedSinceConstraint(Date date)
Sets the optional unmodified constraint that restricts this request
to executing only if the source object has not been
modified after the specified date.
|
CopyObjectRequest |
withAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new object.
|
CopyObjectRequest |
withBucketKeyEnabled(Boolean bucketKeyEnabled)
Specifies whether the client should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS
(SSE-KMS).
|
CopyObjectRequest |
withCannedAccessControlList(CannedAccessControlList cannedACL)
Sets the canned ACL to use for the newly copied object, and returns this
CopyObjectRequest , enabling additional method calls to be chained
together. |
CopyObjectRequest |
withDestinationBucketName(String destinationBucketName)
Sets the name of the destination bucket which will contain the new,
copied object and returns this object, enabling additional method calls
to be chained together.
|
CopyObjectRequest |
withDestinationKey(String destinationKey)
Sets the destination bucket key under which the new, copied object
will be stored and returns this object, enabling additional method calls
can be chained together.
|
CopyObjectRequest |
withDestinationSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to
encrypt the destination object being copied, and returns the updated
request object so that additional method calls can be chained together.
|
CopyObjectRequest |
withExpectedBucketOwner(String expectedBucketOwner)
This value represents the expected account id of the destination Amazon S3 bucket owner.
|
CopyObjectRequest |
withExpectedSourceBucketOwner(String expectedSourceBucketOwner)
This value represents the expected account id of the source Amazon S3 bucket owner.
|
CopyObjectRequest |
withMatchingETagConstraint(String eTag)
Adds a single ETag constraint to this request and returns this object,
enabling additional method calls to be chained together.
|
CopyObjectRequest |
withMetadataDirective(MetadataDirective metadataDirective)
Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.
|
CopyObjectRequest |
withMetadataDirective(String metadataDirective)
Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.
|
CopyObjectRequest |
withModifiedSinceConstraint(Date date)
Sets the optional modified constraint that restricts this request
to executing only if the source object has been modified
after the specified date.
|
CopyObjectRequest |
withNewObjectMetadata(ObjectMetadata newObjectMetadata)
Sets the object metadata to use for the new, copied object and returns
this object, enabling additional method calls to be chained together.
|
CopyObjectRequest |
withNewObjectTagging(ObjectTagging newObjectTagging)
set the tagging for the new object.
|
CopyObjectRequest |
withNonmatchingETagConstraint(String eTag)
Adds a single ETag constraint to this request and returns this object, enabling
additional method calls to be chained together.
|
CopyObjectRequest |
withObjectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus)
Specifies whether you want to apply a Legal Hold to the copied object.
|
CopyObjectRequest |
withObjectLockLegalHoldStatus(String objectLockLegalHoldStatus)
Specifies whether you want to apply a Legal Hold to the copied object.
|
CopyObjectRequest |
withObjectLockMode(ObjectLockMode objectLockMode)
The Object Lock mode that you want to apply to the copied object.
|
CopyObjectRequest |
withObjectLockMode(String objectLockMode)
The Object Lock mode that you want to apply to the copied object.
|
CopyObjectRequest |
withObjectLockRetainUntilDate(Date objectLockRetainUntilDate)
The date and time when you want this object's Object Lock to expire.
|
CopyObjectRequest |
withRedirectLocation(String redirectLocation)
Sets the optional redirect location for the newly copied object.Returns this
CopyObjectRequest , enabling additional method calls to be chained
together. |
CopyObjectRequest |
withRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
CopyObjectRequest |
withSourceBucketName(String sourceBucketName)
Sets the name of the bucket containing the source object to be copied,
and returns this object, enabling additional method calls to be chained
together.
|
CopyObjectRequest |
withSourceKey(String sourceKey)
Sets the key in the source bucket under which the source object to be
copied is stored and returns this object, enabling additional method calls
to be chained together.
|
CopyObjectRequest |
withSourceSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to
decrypt the source object being copied, and returns the updated request
object so that additional method calls can be chained together.
|
CopyObjectRequest |
withSourceVersionId(String sourceVersionId)
Sets the optional version ID specifying which version of the source
object to copy and returns this object, enabling additional method calls
to be chained together.
|
CopyObjectRequest |
withSSEAwsKeyManagementParams(SSEAwsKeyManagementParams sseAwsKeyManagementParams)
Sets the Amazon Web Services Key Management System parameters used to encrypt the object
on server side.
|
CopyObjectRequest |
withStorageClass(StorageClass storageClass)
Sets the optional Amazon S3 storage class to use when storing the newly
copied object and returns this CopyObjectRequest, enabling additional
method calls to be chained together.
|
CopyObjectRequest |
withStorageClass(String storageClass)
Sets the optional Amazon S3 storage class to use when storing the newly
copied object and returns this
CopyObjectRequest , enabling additional
method calls to be chained together. |
CopyObjectRequest |
withUnmodifiedSinceConstraint(Date date)
Sets the optional unmodified constraint that restricts this request
to executing only if the source object has not been
modified after the specified date.
|
addHandlerContext, clone, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getHandlerContext, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestCredentialsProvider, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
public CopyObjectRequest()
CopyObjectRequest
object.
The caller must populate the object fields before the request is ready to be executed.public CopyObjectRequest(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey)
Constructs with basic options.
sourceBucketName
- The name of the S3 bucket containing the object to copy.sourceKey
- The source bucket key under which the object to copy is
stored.destinationBucketName
- The name of the S3 bucket to which the new object will be
copied.destinationKey
- The destination bucket key under which the new object
will be copied.public CopyObjectRequest(String sourceBucketName, String sourceKey, String sourceVersionId, String destinationBucketName, String destinationKey)
Constructs a new CopyObjectRequest
with basic options, providing
an S3 version ID identifying the specific version of the source object
to copy.
sourceBucketName
- The name of the S3 bucket containing the object to copy.sourceKey
- The key in the source bucket under which the object to copy is
stored.sourceVersionId
- The S3 version ID which uniquely identifies a specific version
of the source object to copy.destinationBucketName
- The name of the S3 bucket in which the new object will be
copied.destinationKey
- The key in the destination bucket under which the new object
will be copied.CopyObjectRequest(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey)
public String getExpectedBucketOwner()
getExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public CopyObjectRequest withExpectedBucketOwner(String expectedBucketOwner)
withExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public void setExpectedBucketOwner(String expectedBucketOwner)
setExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public String getExpectedSourceBucketOwner()
ExpectedSourceBucketOwnerRequest
getExpectedSourceBucketOwner
in interface ExpectedSourceBucketOwnerRequest
public CopyObjectRequest withExpectedSourceBucketOwner(String expectedSourceBucketOwner)
ExpectedSourceBucketOwnerRequest
withExpectedSourceBucketOwner
in interface ExpectedSourceBucketOwnerRequest
public void setExpectedSourceBucketOwner(String expectedSourceBucketOwner)
ExpectedSourceBucketOwnerRequest
setExpectedSourceBucketOwner
in interface ExpectedSourceBucketOwnerRequest
public String getSourceBucketName()
setSourceBucketName(String sourceBucketName)
public void setSourceBucketName(String sourceBucketName)
sourceBucketName
- The name of the bucket containing the source object to be
copied.getSourceBucketName()
public CopyObjectRequest withSourceBucketName(String sourceBucketName)
sourceBucketName
- The name of the bucket containing the source object to be
copied.CopyObjectRequest
instance,
enabling additional method calls to be chained together.public String getSourceKey()
setSourceKey(String sourceKey)
public void setSourceKey(String sourceKey)
sourceKey
- The source bucket key under which the source object to
be copied is stored.setSourceKey(String)
public CopyObjectRequest withSourceKey(String sourceKey)
sourceKey
- The key in the source bucket under which the source object to
be copied is stored.CopyObjectRequest
instance, enabling additional method calls to be
chained together.public String getSourceVersionId()
Gets the version ID specifying which version of the source object to copy. If not specified, the most recent version of the source object will be copied.
Objects created before enabling versioning or when versioning is
suspended are given the default null
version ID (see
Constants.NULL_VERSION_ID
). Note that the
null
version ID is a valid version ID and is not the
same as not having a version ID.
For more information about enabling versioning for a bucket, see
AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
Constants.NULL_VERSION_ID
,
setSourceVersionId(String sourceVersionId)
public void setSourceVersionId(String sourceVersionId)
Sets the optional version ID specifying which version of the source object to copy. If not specified, the most recent version of the source object will be copied.
Objects created before enabling versioning or when versioning is
suspended are given the default null
version ID (see
Constants.NULL_VERSION_ID
). Note that the
null
version ID is a valid version ID and is not the
same as not having a version ID.
For more information about enabling versioning for a bucket, see
AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
sourceVersionId
- The optional version ID specifying which version of the
source object to copy.public CopyObjectRequest withSourceVersionId(String sourceVersionId)
Sets the optional version ID specifying which version of the source object to copy and returns this object, enabling additional method calls to be chained together. If not specified, the most recent version of the source object will be copied.
Objects created before enabling versioning or when versioning is
suspended are given the default null
version ID (see
Constants.NULL_VERSION_ID
). Note that the
null
version ID is a valid version ID and is not the
same as not having a version ID.
For more information about enabling versioning for a bucket, see
AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
sourceVersionId
- The optional version ID specifying which version of the
source object to copy.CopyObjectRequest
, enabling additional method calls to be
chained together.public String getDestinationBucketName()
The name of the destination bucket.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The
S3 on Outposts hostname takes the form
AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
When you use this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts in the
Amazon S3 User Guide.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts
hostname. The S3 on Outposts hostname takes the form
AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
When you use this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts
in the Amazon S3 User Guide.
setDestinationBucketName(String destinationBucketName)
public void setDestinationBucketName(String destinationBucketName)
destinationBucketName
- The name of the destination bucket which will contain the new,
copied object.getDestinationBucketName()
public CopyObjectRequest withDestinationBucketName(String destinationBucketName)
destinationBucketName
- The name of the destination bucket which will contain the new,
copied object.CopyObjectRequest
, enabling additional method calls to be
chained together.public String getDestinationKey()
setDestinationKey(String destinationKey)
public void setDestinationKey(String destinationKey)
destinationKey
- The destination bucket key under which the new, copied
object will be stored.getDestinationKey()
public CopyObjectRequest withDestinationKey(String destinationKey)
destinationKey
- The destination bucket key under which the new, copied
object will be stored.CopyObjectRequest
, enabling additional method calls to be
chained together.public String getStorageClass()
By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For more information, see Storage Classes in the Amazon S3 User Guide.
StorageClass
public void setStorageClass(String storageClass)
Sets the optional Amazon S3 storage class to use when storing the newly copied object. If not specified, the default standard storage class is used.
For more information on Amazon S3 storage classes and available values,
see the StorageClass
enumeration.
getStorageClass()
,
setStorageClass(StorageClass)
public CopyObjectRequest withStorageClass(String storageClass)
Sets the optional Amazon S3 storage class to use when storing the newly
copied object and returns this CopyObjectRequest
, enabling additional
method calls to be chained together. If not specified, the default
standard storage class is used.
For more information on Amazon S3 storage classes and available values,
see the StorageClass
enumeration.
CopyObjectRequest
, enabling additional method calls to be
chained together.public void setStorageClass(StorageClass storageClass)
Sets the optional Amazon S3 storage class to use when storing the newly copied object. If not specified, the default standard storage class is used.
For more information on Amazon S3 storage classes and available values,
see the StorageClass
enumeration.
getStorageClass()
,
setStorageClass(String)
public CopyObjectRequest withStorageClass(StorageClass storageClass)
Sets the optional Amazon S3 storage class to use when storing the newly copied object and returns this CopyObjectRequest, enabling additional method calls to be chained together. If not specified, the default standard storage class is used.
For more information on Amazon S3 storage classes and available values,
see the StorageClass
enumeration.
CopyObjectRequest
, enabling additional method calls to be
chained together.public CannedAccessControlList getCannedAccessControlList()
CannedAccessControlList.Private
canned ACL for all copied
objects.null
if no
canned ACL has been specified.public void setCannedAccessControlList(CannedAccessControlList cannedACL)
CannedAccessControlList.Private
canned ACL for all copied
objects.cannedACL
- The canned ACL to set for the newly copied object.public CopyObjectRequest withCannedAccessControlList(CannedAccessControlList cannedACL)
CopyObjectRequest
, enabling additional method calls to be chained
together.cannedACL
- The canned ACL to set for the newly copied object.CopyObjectRequest
, enabling additional method calls to be
chained together.public AccessControlList getAccessControlList()
public void setAccessControlList(AccessControlList accessControlList)
accessControlList
- The access control list for the new object.public CopyObjectRequest withAccessControlList(AccessControlList accessControlList)
CopyObjectRequest
,
enabling additional method calls to be chained together.accessControlList
- The access control list for the new object.public ObjectMetadata getNewObjectMetadata()
null
if no object metadata has been specified.setNewObjectMetadata(ObjectMetadata newObjectMetadata)
public void setNewObjectMetadata(ObjectMetadata newObjectMetadata)
newObjectMetadata
- The object metadata to use for the newly copied object.getNewObjectMetadata()
public CopyObjectRequest withNewObjectMetadata(ObjectMetadata newObjectMetadata)
newObjectMetadata
- The object metadata to use for the newly copied object.CopyObjectRequest
, enabling additional method calls to be
chained together.public List<String> getMatchingETagConstraints()
Gets the optional list of ETag constraints that, when present, must include a match for the source object's current ETag in order for the copy object request to be executed. Only one ETag in the list needs to match for the request to be executed by Amazon S3.
Matching ETag constraints may be used with the unmodified since constraint, but not with any other type of constraint.
public void setMatchingETagConstraints(List<String> eTagList)
Sets the optional list of ETag constraints that, when present, must include a match for the source object's current ETag in order for the copy object request to be executed. If none of the specified ETags match the source object's current ETag, the copy object operation will be aborted. Only one ETag in the list needs to match for the request to be executed by Amazon S3.
Matching ETag constraints may be used with the unmodified since constraint, but not with any other type of constraint.
eTagList
- The optional list of ETag constraints that must include a
match for the source object's current ETag in order for this
request to be executed.public CopyObjectRequest withMatchingETagConstraint(String eTag)
Adds a single ETag constraint to this request and returns this object, enabling additional method calls to be chained together. Multiple ETag constraints can be added to a request, but one must match the source object's current ETag in order for the copy object request to be executed. If none of the ETag constraints added to this request match the source object's current ETag, the copy object operation will be aborted.
Matching ETag constraints may be used with the unmodified since constraint, but not with any other type of constraint.
eTag
- The matching ETag constraint to add to this request.CopyObjectRequest
, enabling additional method calls to be
chained together.public List<String> getNonmatchingETagConstraints()
Gets the optional list of ETag constraints that, when present, must not include a match for the source object's current ETag in order for the copy object request to be executed. If any entry in the non-matching ETag constraint list matches the source object's current ETag, this copy request will not be executed by Amazon S3.
Non-matching ETag constraints may be used with the modified since constraint, but not with any other type of constraint.
public void setNonmatchingETagConstraints(List<String> eTagList)
Sets the optional list of ETag constraints that, when present, must not include a match for the source object's current ETag in order for the copy object request to be executed. If any entry in the non-matching ETag constraint list matches the source object's current ETag, this copy request will not be executed by Amazon S3.
Non-matching ETag constraints may be used with the modified since constraint, but not with any other type of constraint.
eTagList
- The list of ETag constraints that, when present, must not
include a match for the source object's current ETag in
order for this request to be executed.public CopyObjectRequest withNonmatchingETagConstraint(String eTag)
Adds a single ETag constraint to this request and returns this object, enabling additional method calls to be chained together. Multiple ETag constraints can be added to a request, but all ETag constraints must not match the source object's current ETag in order for the copy object request to be executed. If any entry in the non-matching ETag constraint list matches the source object's current ETag, this copy request will not be executed by Amazon S3.
Non-matching ETag constraints may be used with the modified since constraint, but not with any other type of constraint.
eTag
- The non-matching ETag constraint to add to this request.CopyObjectRequest
, enabling additional method calls to be
chained together.public Date getUnmodifiedSinceConstraint()
Gets the optional unmodified constraint that restricts this request to executing only if the source object has not been modified after the specified date.
The unmodified since constraint may be used with matching ETag constraints, but not with any other type of constraint.
public void setUnmodifiedSinceConstraint(Date date)
Sets the optional unmodified constraint that restricts this request to executing only if the source object has not been modified after the specified date.
The unmodified constraint may be used with matching ETag constraints, but not with any other type of constraint.
Note that Amazon S3 will ignore any dates occurring in the future.
date
- The unmodified constraint that restricts this request to
executing only if the source object has not been
modified after this date.public CopyObjectRequest withUnmodifiedSinceConstraint(Date date)
Sets the optional unmodified constraint that restricts this request to executing only if the source object has not been modified after the specified date. Returns this object, enabling additional method calls to be chained together.
The unmodified constraint may be used with matching ETag constraints, but not with any other type of constraint.
Note that Amazon S3 will ignore any dates occurring in the future.
date
- The unmodified constraint that restricts this request to
executing only if the source object has not been
modified after this date.CopyObjectRequest
, enabling additional method calls to be
chained together.public Date getModifiedSinceConstraint()
Gets the optional modified constraint that restricts this request to executing only if the source object has been modified after the specified date.
The modified constraint may be used with non-matching ETag constraints, but not with any other type of constraint.
public void setModifiedSinceConstraint(Date date)
Sets the optional modified constraint that restricts this request to executing only if the source object has been modified after the specified date.
The modified constraint may be used with non-matching ETag constraints, but not with any other type of constraint.
Note that Amazon S3 will ignore any dates occurring in the future.
date
- The modified constraint that restricts this request to
executing only if the source object has been
modified after the specified date.public CopyObjectRequest withModifiedSinceConstraint(Date date)
Sets the optional modified constraint that restricts this request to executing only if the source object has been modified after the specified date. Returns this object, enabling additional method calls to be chained together.
The modified constraint may be used with non-matching ETag constraints, but not with any other type of constraint.
Note that Amazon S3 will ignore any dates occurring in the future.
date
- The modified constraint that restricts this request to
executing only if the source object has been
modified after the specified date.CopyObjectRequest
, enabling additional method calls to be
chained together.public void setRedirectLocation(String redirectLocation)
redirectLocation
- The redirect location for the newly copied object.public String getRedirectLocation()
public CopyObjectRequest withRedirectLocation(String redirectLocation)
CopyObjectRequest
, enabling additional method calls to be chained
together.redirectLocation
- The redirect location for the newly copied object.public SSECustomerKey getSourceSSECustomerKey()
public void setSourceSSECustomerKey(SSECustomerKey sseKey)
sseKey
- The optional customer-provided server-side encryption key to
use to decrypt the source object being copied.public CopyObjectRequest withSourceSSECustomerKey(SSECustomerKey sseKey)
sseKey
- The optional customer-provided server-side encryption key to
use to decrypt the source object being copied.public SSECustomerKey getDestinationSSECustomerKey()
public void setDestinationSSECustomerKey(SSECustomerKey sseKey)
sseKey
- The optional customer-provided server-side encryption key to
use to encrypt the destination object being copied.public CopyObjectRequest withDestinationSSECustomerKey(SSECustomerKey sseKey)
sseKey
- The optional customer-provided server-side encryption key to
use to encrypt the destination object being copied.public SSEAwsKeyManagementParams getSSEAwsKeyManagementParams()
getSSEAwsKeyManagementParams
in interface SSEAwsKeyManagementParamsProvider
public void setSSEAwsKeyManagementParams(SSEAwsKeyManagementParams params)
public CopyObjectRequest withSSEAwsKeyManagementParams(SSEAwsKeyManagementParams sseAwsKeyManagementParams)
public boolean isRequesterPays()
If a bucket is enabled for Requester Pays, then any attempt to upload or download an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket
public void setRequesterPays(boolean isRequesterPays)
If a bucket is enabled for Requester Pays, then any attempt to upload or download an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket.
isRequesterPays
- Enable Requester Pays option for the operation.public CopyObjectRequest withRequesterPays(boolean isRequesterPays)
If a bucket is enabled for Requester Pays, then any attempt to upload or download an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket.
isRequesterPays
- Enable Requester Pays option for the operation.public ObjectTagging getNewObjectTagging()
public void setNewObjectTagging(ObjectTagging newObjectTagging)
newObjectTagging
- the tagging for the new object.public CopyObjectRequest withNewObjectTagging(ObjectTagging newObjectTagging)
newObjectTagging
- the tagging for the new object.public String getMetadataDirective()
public void setMetadataDirective(String metadataDirective)
metadataDirective
- New value for the metadata directive.public CopyObjectRequest withMetadataDirective(String metadataDirective)
metadataDirective
- New value for the metadata directive.public CopyObjectRequest withMetadataDirective(MetadataDirective metadataDirective)
metadataDirective
- New value for the metadata directive.public String getObjectLockMode()
public CopyObjectRequest withObjectLockMode(String objectLockMode)
public CopyObjectRequest withObjectLockMode(ObjectLockMode objectLockMode)
public void setObjectLockMode(String objectLockMode)
public void setObjectLockMode(ObjectLockMode objectLockMode)
public Date getObjectLockRetainUntilDate()
public CopyObjectRequest withObjectLockRetainUntilDate(Date objectLockRetainUntilDate)
public void setObjectLockRetainUntilDate(Date objectLockRetainUntilDate)
public String getObjectLockLegalHoldStatus()
public CopyObjectRequest withObjectLockLegalHoldStatus(String objectLockLegalHoldStatus)
public CopyObjectRequest withObjectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus)
public void setObjectLockLegalHoldStatus(String objectLockLegalHoldStatus)
public void setObjectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus)
public Boolean getBucketKeyEnabled()
public void setBucketKeyEnabled(Boolean bucketKeyEnabled)
true
causes the client to use an S3 Bucket Key for object encryption with
SSE-KMS.
Specifying this header with a COPY operation does not affect bucket-level settings for S3 Bucket Key.
public CopyObjectRequest withBucketKeyEnabled(Boolean bucketKeyEnabled)
true
causes the client to use an S3 Bucket Key for object encryption with
SSE-KMS.
Specifying this header with a COPY operation does not affect bucket-level settings for S3 Bucket Key.