Class CopyObjectRequest
- All Implemented Interfaces:
ReadLimitInfo
,S3AccelerateUnsupported
,SSEAwsKeyManagementParamsProvider
,Serializable
,Cloneable
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:
- Object metadata for new object,
- A
CannedAccessControlList
for the new object, - Constraints controlling if the copy will be performed or not.
- See Also:
-
Field Summary
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
Constructor Summary
ConstructorsConstructorDescriptionCopyObjectRequest
(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 newCopyObjectRequest
with basic options, providing an S3 version ID identifying the specific version of the source object to copy. -
Method Summary
Modifier and TypeMethodDescriptionReturns the optional access control list for the new object.Gets the canned ACL to use for the new, copied object.Gets the destination bucket name which will contain the new, copied object.Gets the destination bucket key under which the new, copied object will be stored.Returns the optional customer-provided server-side encryption key to use to encrypt the destination object being copied.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.Gets the optional modified constraint that restricts this request to executing only if the source object has been modified after the specified date.Gets the optional object metadata to set for the new, copied object.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.Gets the optional redirect location for the newly copied object.Gets the name of the bucket containing the source object to be copied.Gets the source bucket key under which the source object to be copied is stored.Returns the optional customer-provided server-side encryption key to use to decrypt the source object being copied.Gets the version ID specifying which version of the source object to copy.Returns the AWS Key Management System parameters used to encrypt the object on server side.Gets the optional Amazon S3 storage class to use when storing the newly copied object.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
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
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
Sets the optional customer-provided server-side encryption key to use to encrypt the destination object being copied.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
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
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
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
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
Sets the AWS 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
Sets the optional unmodified constraint that restricts this request to executing only if the source object has not been modified after the specified date.withAccessControlList
(AccessControlList accessControlList) Sets the optional access control list for the new object.Sets the canned ACL to use for the newly copied object, and returns thisCopyObjectRequest
, enabling additional method calls to be chained together.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.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.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.Adds a single ETag constraint to this request and returns this object, enabling additional method calls to be chained together.Sets the optional modified constraint that restricts this request to executing only if the source object has been modified after the specified date.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.Adds a single ETag constraint to this request and returns this object, enabling additional method calls to be chained together.withRedirectLocation
(String redirectLocation) Sets the optional redirect location for the newly copied object.Returns thisCopyObjectRequest
, enabling additional method calls to be chained together.withRequesterPays
(boolean isRequesterPays) Used for conducting this operation from a Requester Pays Bucket.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.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.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.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.withSSEAwsKeyManagementParams
(SSEAwsKeyManagementParams sseAwsKeyManagementParams) Sets the AWS Key Management System parameters used to encrypt the object on server side.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.withStorageClass
(String storageClass) Sets the optional Amazon S3 storage class to use when storing the newly copied object and returns thisCopyObjectRequest
, enabling additional method calls to be chained together.Sets the optional unmodified constraint that restricts this request to executing only if the source object has not been modified after the specified date.Methods inherited from class com.amazonaws.AmazonWebServiceRequest
clone, copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
-
Constructor Details
-
CopyObjectRequest
public CopyObjectRequest(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey) Constructs with basic options.
- Parameters:
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.
-
CopyObjectRequest
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.- Parameters:
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.- See Also:
-
-
Method Details
-
getSourceBucketName
Gets the name of the bucket containing the source object to be copied.- Returns:
- The name of the bucket containing the source object to be copied.
- See Also:
-
setSourceBucketName
Sets the name of the bucket containing the source object to be copied.- Parameters:
sourceBucketName
- The name of the bucket containing the source object to be copied.- See Also:
-
withSourceBucketName
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.- Parameters:
sourceBucketName
- The name of the bucket containing the source object to be copied.- Returns:
- This
CopyObjectRequest
instance, enabling additional method calls to be chained together.
-
getSourceKey
Gets the source bucket key under which the source object to be copied is stored.- Returns:
- The source bucket key under which the source object to be copied is stored.
- See Also:
-
setSourceKey
Sets the source bucket key under which the source object to be copied is stored.- Parameters:
sourceKey
- The source bucket key under which the source object to be copied is stored.- See Also:
-
withSourceKey
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.- Parameters:
sourceKey
- The key in the source bucket under which the source object to be copied is stored.- Returns:
- This
CopyObjectRequest
instance, enabling additional method calls to be chained together.
-
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 (seeConstants.NULL_VERSION_ID
). Note that thenull
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)
.- Returns:
- The version ID specifying which version of the source object to copy.
- See Also:
-
setSourceVersionId
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 (seeConstants.NULL_VERSION_ID
). Note that thenull
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)
.- Parameters:
sourceVersionId
- The optional version ID specifying which version of the source object to copy.
-
withSourceVersionId
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 (seeConstants.NULL_VERSION_ID
). Note that thenull
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)
.- Parameters:
sourceVersionId
- The optional version ID specifying which version of the source object to copy.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
getDestinationBucketName
Gets the destination bucket name which will contain the new, copied object.- Returns:
- The name of the destination bucket which will contain the new, copied object.
- See Also:
-
setDestinationBucketName
Sets the destination bucket name which will contain the new, copied object.- Parameters:
destinationBucketName
- The name of the destination bucket which will contain the new, copied object.- See Also:
-
withDestinationBucketName
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.- Parameters:
destinationBucketName
- The name of the destination bucket which will contain the new, copied object.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
getDestinationKey
Gets the destination bucket key under which the new, copied object will be stored.- Returns:
- The destination bucket key under which the new, copied object will be stored.
- See Also:
-
setDestinationKey
Sets the destination bucket key under which the new, copied object will be stored.- Parameters:
destinationKey
- The destination bucket key under which the new, copied object will be stored.- See Also:
-
withDestinationKey
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.- Parameters:
destinationKey
- The destination bucket key under which the new, copied object will be stored.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
getStorageClass
Gets 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 available Amazon S3 storage classes, see the
StorageClass
enumeration.- Returns:
- The Amazon S3 storage class to use when storing the newly copied object.
- See Also:
-
setStorageClass
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.- See Also:
-
withStorageClass
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.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
setStorageClass
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.- See Also:
-
withStorageClass
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.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
getCannedAccessControlList
Gets the canned ACL to use for the new, copied object. If no canned ACL is specified, S3 will default to using theCannedAccessControlList.Private
canned ACL for all copied objects.- Returns:
- The canned ACL to set for the newly copied object,
or
null
if no canned ACL has been specified.
-
setCannedAccessControlList
Sets the canned ACL to use for the newly copied object. If no canned ACL is specified, S3 will default to using theCannedAccessControlList.Private
canned ACL for all copied objects.- Parameters:
cannedACL
- The canned ACL to set for the newly copied object.
-
withCannedAccessControlList
Sets the canned ACL to use for the newly copied object, and returns thisCopyObjectRequest
, enabling additional method calls to be chained together.- Parameters:
cannedACL
- The canned ACL to set for the newly copied object.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
getAccessControlList
Returns the optional access control list for the new object. If specified, cannedAcl will be ignored. -
setAccessControlList
Sets the optional access control list for the new object. If specified, cannedAcl will be ignored.- Parameters:
accessControlList
- The access control list for the new object.
-
withAccessControlList
Sets the optional access control list for the new object. If specified, cannedAcl will be ignored. Returns thisCopyObjectRequest
, enabling additional method calls to be chained together.- Parameters:
accessControlList
- The access control list for the new object.
-
getNewObjectMetadata
Gets the optional object metadata to set for the new, copied object.- Returns:
- The object metadata to set for the newly copied object.
Returns
null
if no object metadata has been specified. - See Also:
-
setNewObjectMetadata
Sets the object metadata to use for the new, copied object. By default the object metadata from the source object is copied to the destination object, but when setting object metadata with this method, no metadata from the source object is copied. Instead, the new destination object will have the metadata specified with this call.- Parameters:
newObjectMetadata
- The object metadata to use for the newly copied object.- See Also:
-
withNewObjectMetadata
Sets the object metadata to use for the new, copied object and returns this object, enabling additional method calls to be chained together. By default, the object metadata from the source object will be copied to the destination object, but if callers set object metadata with this method, it will be used instead.- Parameters:
newObjectMetadata
- The object metadata to use for the newly copied object.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
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.
- Returns:
- The optional list of ETag constraints that when present must include a match for the source object's current ETag in order for this request to be executed.
-
setMatchingETagConstraints
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.
- Parameters:
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.
-
withMatchingETagConstraint
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.
- Parameters:
eTag
- The matching ETag constraint to add to this request.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
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.
- Returns:
- The optional 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.
-
setNonmatchingETagConstraints
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.
- Parameters:
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.
-
withNonmatchingETagConstraint
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.
- Parameters:
eTag
- The non-matching ETag constraint to add to this request.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
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.
- Returns:
- The optional unmodified constraint that restricts this request to executing only if the source object has not been modified after the specified date.
-
setUnmodifiedSinceConstraint
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.
- Parameters:
date
- The unmodified constraint that restricts this request to executing only if the source object has not been modified after this date.
-
withUnmodifiedSinceConstraint
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.
- Parameters:
date
- The unmodified constraint that restricts this request to executing only if the source object has not been modified after this date.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
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.
- Returns:
- The optional modified constraint that restricts this request to executing only if the source object has been modified after the specified date.
-
setModifiedSinceConstraint
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.
- Parameters:
date
- The modified constraint that restricts this request to executing only if the source object has been modified after the specified date.
-
withModifiedSinceConstraint
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.
- Parameters:
date
- The modified constraint that restricts this request to executing only if the source object has been modified after the specified date.- Returns:
- This
CopyObjectRequest
, enabling additional method calls to be chained together.
-
setRedirectLocation
Sets the optional redirect location for the newly copied object.- Parameters:
redirectLocation
- The redirect location for the newly copied object.
-
getRedirectLocation
Gets the optional redirect location for the newly copied object. -
withRedirectLocation
Sets the optional redirect location for the newly copied object.Returns thisCopyObjectRequest
, enabling additional method calls to be chained together.- Parameters:
redirectLocation
- The redirect location for the newly copied object.
-
getSourceSSECustomerKey
Returns the optional customer-provided server-side encryption key to use to decrypt the source object being copied.- Returns:
- The optional customer-provided server-side encryption key to use to decrypt the source object being copied.
-
setSourceSSECustomerKey
Sets the optional customer-provided server-side encryption key to use to decrypt the source object being copied.- Parameters:
sseKey
- The optional customer-provided server-side encryption key to use to decrypt the source object being copied.
-
withSourceSSECustomerKey
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.- Parameters:
sseKey
- The optional customer-provided server-side encryption key to use to decrypt the source object being copied.- Returns:
- This updated request object so that additional method calls can be chained together.
-
getDestinationSSECustomerKey
Returns the optional customer-provided server-side encryption key to use to encrypt the destination object being copied.- Returns:
- The optional customer-provided server-side encryption key to use to encrypt the destination object being copied.
-
setDestinationSSECustomerKey
Sets the optional customer-provided server-side encryption key to use to encrypt the destination object being copied.- Parameters:
sseKey
- The optional customer-provided server-side encryption key to use to encrypt the destination object being copied.
-
withDestinationSSECustomerKey
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.- Parameters:
sseKey
- The optional customer-provided server-side encryption key to use to encrypt the destination object being copied.- Returns:
- This updated request object so that additional method calls can be chained together.
-
getSSEAwsKeyManagementParams
Returns the AWS Key Management System parameters used to encrypt the object on server side.- Specified by:
getSSEAwsKeyManagementParams
in interfaceSSEAwsKeyManagementParamsProvider
- Returns:
- The optional SSEAwsKeyManagementParams to use to encrypt the uploaded object.
-
setSSEAwsKeyManagementParams
Sets the AWS Key Management System parameters used to encrypt the object on server side. -
withSSEAwsKeyManagementParams
public CopyObjectRequest withSSEAwsKeyManagementParams(SSEAwsKeyManagementParams sseAwsKeyManagementParams) Sets the AWS Key Management System parameters used to encrypt the object on server side.- Returns:
- returns the update CopyObjectRequest
-
isRequesterPays
public boolean isRequesterPays()Returns true if the user has enabled Requester Pays option when conducting this operation from Requester Pays Bucket; else false.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
- Returns:
- true if the user has enabled Requester Pays option for conducting this operation from Requester Pays Bucket.
-
setRequesterPays
public void setRequesterPays(boolean isRequesterPays) Used for conducting this operation from a Requester Pays Bucket. If set the requester is charged for requests from the bucket.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.
- Parameters:
isRequesterPays
- Enable Requester Pays option for the operation.
-
withRequesterPays
Used for conducting this operation from a Requester Pays Bucket. If set the requester is charged for requests from the bucket. It returns this updated CopyObjectRequest object so that additional method calls can be chained together.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.
- Parameters:
isRequesterPays
- Enable Requester Pays option for the operation.- Returns:
- The updated CopyObjectRequest object.
-