Class CopyPartRequest
- All Implemented Interfaces:
ReadLimitInfo
,S3AccelerateUnsupported
,Serializable
,Cloneable
Provides options for copying an Amazon S3 object from a source location to a part of a multipart upload.
All CopyPartRequests
must specify an upload id, a source bucket
and key, along with a destination bucket and key. Beyond that, requests also
specify constraints controlling if the copy will be performed or not.
- See Also:
-
Field Summary
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets 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 source object part being copied.Returns the optional start range to copy from the source object.Returns the optional zero-based byte offset to stop copying the source.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 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.int
Returns the part number describing this part's position relative to the other parts in the multipart upload.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 part being copied.Gets the version ID specifying which version of the source object to copy.Gets the optional unmodified constraint that restricts this request to executing only if the source object has not been modified after the specified date.Returns the ID of the existing, initiated multipart upload with which this new part will be associated.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 source object part being copied.void
setFirstByte
(Long firstByte) Sets the optional zero-based byte offset to begin copying the source object.void
setLastByte
(Long lastByte) Sets the optional zero-based byte offset to stop copying the source.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
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
setPartNumber
(int partNumber) Sets the part number describing this part's position relative to the other parts in the multipart upload.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 part being copied.void
setSourceVersionId
(String sourceVersionId) Sets the optional version ID specifying which version of the source object to copy.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.void
setUploadId
(String uploadId) Sets the ID of the existing, initiated multipart upload with which this new part will be associated.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.Returns the optional customer-provided server-side encryption key to use to encrypt the source object part being copied, and returns the updated request object so that additional method calls can be chained together.withFirstByte
(Long firstByte) Sets the optional zero-based byte offset to begin copying the source object.withLastByte
(Long lastByte) Sets the optional zero-based byte offset to stop copying the source.Adds a single ETag constraint to this request and returns this object, enabling additional method calls to be chained together.withMatchingETagConstraints
(List<String> eTagList) Fluent API forsetMatchingETagConstraints(List)
.Sets the optional modified constraint that restricts this request to executing only if the source object has been modified after the specified date.Adds a single ETag constraint to this request and returns this object, enabling additional method calls to be chained together.withNonmatchingETagConstraints
(List<String> eTagList) Fluent API forsetNonmatchingETagConstraints(List)
.withPartNumber
(int partNumber) Sets the part number describing this part's position relative to the other parts in the multipart upload.withSourceBucketName
(String sourceBucketName) Sets the name of the bucket containing the source object to be copied.withSourceKey
(String sourceKey) Sets the source bucket key under which the source object to be copied is stored.Sets the optional customer-provided server-side encryption key to use to decrypt the source object part 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.Sets the optional unmodified constraint that restricts this request to executing only if the source object has not been modified after the specified date.withUploadId
(String uploadId) Sets the ID of the existing, initiated multipart upload with which this new part will be associated.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
-
CopyPartRequest
public CopyPartRequest()
-
-
Method Details
-
getUploadId
Returns the ID of the existing, initiated multipart upload with which this new part will be associated.- Returns:
- the ID of the existing, initiated multipart upload with which this new part will be associated.
-
setUploadId
Sets the ID of the existing, initiated multipart upload with which this new part will be associated.- Parameters:
uploadId
- the ID of the existing, initiated multipart upload with which this new part will be associated.
-
withUploadId
Sets the ID of the existing, initiated multipart upload with which this new part will be associated.- Parameters:
uploadId
- the ID of the existing, initiated multipart upload with which this new part will be associated. * @return ThisCopyPartRequest
, enabling additional method calls to be chained together.
-
getPartNumber
public int getPartNumber()Returns the part number describing this part's position relative to the other parts in the multipart upload. Part number must be between 1 and 10,000 (inclusive).- Returns:
- the part number describing this part's position relative to the other parts in the multipart upload. Part number must be between 1 and 10,000 (inclusive).
-
setPartNumber
public void setPartNumber(int partNumber) Sets the part number describing this part's position relative to the other parts in the multipart upload. Part number must be between 1 and 10,000 (inclusive).- Parameters:
partNumber
- the part number describing this part's position relative to the other parts in the multipart upload. Part number must be between 1 and 10,000 (inclusive).
-
withPartNumber
Sets the part number describing this part's position relative to the other parts in the multipart upload. Part number must be between 1 and 10,000 (inclusive).- Parameters:
partNumber
- the part number describing this part's position relative to the other parts in the multipart upload. Part number must be between 1 and 10,000 (inclusive).- Returns:
- This
CopyPartRequest
, enabling additional method calls to be chained together.
-
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.- Parameters:
sourceBucketName
- The name of the bucket containing the source object to be copied.- Returns:
- This
CopyPartRequest
, enabling additional method calls to be chained together. - See Also:
-
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 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.- Returns:
- This
CopyPartRequest
, enabling additional method calls to be chained together. - See Also:
-
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. 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
CopyPartRequest
, 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
CopyPartRequest
, 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
CopyPartRequest
, enabling additional method calls to be chained together.
-
getFirstByte
Returns the optional start range to copy from the source object.- Returns:
- the optional start range to copy from the source object.
-
setFirstByte
Sets the optional zero-based byte offset to begin copying the source object.- Parameters:
firstByte
- the optional zero-based byte offset to begin copying the source object.
-
withFirstByte
Sets the optional zero-based byte offset to begin copying the source object.- Parameters:
firstByte
- the optional zero-based byte offset to begin copying the source object.- Returns:
- This
CopyPartRequest
, enabling additional method calls to be chained together.
-
getLastByte
Returns the optional zero-based byte offset to stop copying the source.- Returns:
- the optional zero-based byte offset to stop copying the source.
-
setLastByte
Sets the optional zero-based byte offset to stop copying the source. -
withLastByte
Sets the optional zero-based byte offset to stop copying the source.- Returns:
- This
CopyPartRequest
, 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.
-
withMatchingETagConstraints
Fluent API forsetMatchingETagConstraints(List)
. -
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
CopyPartRequest
, 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.
-
withNonmatchingETagConstraints
Fluent API forsetNonmatchingETagConstraints(List)
. -
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
CopyPartRequest
, 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
CopyPartRequest
, 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
CopyPartRequest
, enabling additional method calls to be chained together.
-
getSourceSSECustomerKey
Returns the optional customer-provided server-side encryption key to use to decrypt the source object part being copied.- Returns:
- The optional customer-provided server-side encryption key to use to decrypt the source object part being copied.
-
setSourceSSECustomerKey
Sets the optional customer-provided server-side encryption key to use to decrypt the source object part being copied.- Parameters:
sseKey
- The optional customer-provided server-side encryption key to use to decrypt the source object part being copied.
-
withSourceSSECustomerKey
Sets the optional customer-provided server-side encryption key to use to decrypt the source object part 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 part 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 source object part being copied.- Returns:
- The optional customer-provided server-side encryption key to use to encrypt the source object part being copied.
-
setDestinationSSECustomerKey
Sets the optional customer-provided server-side encryption key to use to encrypt the source object part being copied.- Parameters:
sseKey
- The optional customer-provided server-side encryption key to use to encrypt the source object part being copied.
-
withDestinationSSECustomerKey
Returns the optional customer-provided server-side encryption key to use to encrypt the source object part 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 source object part being copied.- Returns:
- This updated request object so that additional method calls can be chained together.
-