Class UploadPartRequest
- All Implemented Interfaces:
ReadLimitInfo
,S3DataSource
,SSECustomerKeyProvider
,Serializable
,Cloneable
If you are uploading parts for KMS-encrypted objects, you need to specify the correct region of the bucket on your client and configure AWS Signature Version 4 for added security. For more information on how to do this, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify -signature-version
Required Parameters: BucketName, Key, UploadId, PartNumber
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.amazonaws.services.s3.model.S3DataSource
S3DataSource.Utils
-
Field Summary
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the bucket containing the existing, initiated multipart upload, with which this new part will be associated.getFile()
Returns the file containing the data to upload.long
Returns the optional offset in the specified file, at which to begin uploading data for this part.Returns the stream containing the data to upload for the new part.getKey()
Returns the key of the initiated multipart upload.Returns the optional, but recommended, MD5 hash of the content of this part.Returns the additional information about the part being uploaded.int
Returns the part number describing this part's position relative to the other parts in the multipart upload.long
Returns the size of this part, in bytes.Deprecated.Returns the optional customer-provided server-side encryption key to use to encrypt the uploaded object.Returns the ID of the existing, initiated multipart upload with which this new part will be associated.boolean
Returns true if the creator of this request has indicated this part is the last part being uploaded in a multipart upload.boolean
Returns true if the user has enabled Requester Pays option when conducting this operation from Requester Pays Bucket; else false.void
setBucketName
(String bucketName) Sets the name of the bucket containing the existing, initiated multipart upload, with which this new part will be associated.void
Sets the file containing the data to upload.void
setFileOffset
(long fileOffset) Sets the optional offset in the specified file, at which to begin uploading data for this part.void
setInputStream
(InputStream inputStream) Sets the stream containing the data to upload for the new part.void
Sets the key of the initiated multipart upload.void
setLastPart
(boolean isLastPart) Marks this part as the last part being uploaded in a multipart upload.void
setMd5Digest
(String md5Digest) Sets the optional, but recommended, MD5 hash of the content of this part.void
setObjectMetadata
(ObjectMetadata objectMetadata) Sets the additional information about the part being uploaded.void
setPartNumber
(int partNumber) Sets the part number describing this part's position relative to the other parts in the multipart upload.void
setPartSize
(long partSize) Sets the size of this part, in bytes.void
setProgressListener
(ProgressListener progressListener) Deprecated.void
setRequesterPays
(boolean isRequesterPays) Used for conducting this operation from a Requester Pays Bucket.void
setSSECustomerKey
(SSECustomerKey sseKey) Sets the optional customer-provided server-side encryption key to use to encrypt the object part being uploaded.void
setUploadId
(String uploadId) Sets the ID of the existing, initiated multipart upload with which this new part will be associated.withBucketName
(String bucketName) Sets the name of the bucket containing the existing, initiated multipart upload, with which this new part will be associated, and returns this updated object so that additional method calls can be chained together.Sets the file containing the data to upload, and returns this updated UploadPartRequest object so that additional method calls can be chained together.withFileOffset
(long fileOffset) Sets the optional offset in the specified file, at which to begin uploading data for this part, and returns this updated UploadPartRequest object so that additional method calls can be chained together.withInputStream
(InputStream inputStream) Sets the stream containing the data to upload for the new part, and returns this updated object so that additional method calls can be chained together.Sets the key of the initiated multipart upload, and returns this updated object so that additional method calls can be chained together.withLastPart
(boolean isLastPart) Marks this part as the last part being uploaded in a multipart upload, and returns this updated request object so that additional method calls can be chained together.withMD5Digest
(String md5Digest) Sets the optional, but recommended, MD5 hash of the content of this part.withObjectMetadata
(ObjectMetadata objectMetadata) Fluent API forsetObjectMetadata(ObjectMetadata)
.withPartNumber
(int partNumber) Sets the part number describing this part's position relative to the other parts in the multipart upload.withPartSize
(long partSize) Sets the size of this part, in bytes, and returns this updated UploadPartRequest object so that additional method calls can be chained together.withProgressListener
(ProgressListener progressListener) Deprecated.withRequesterPays
(boolean isRequesterPays) Used for conducting this operation from a Requester Pays Bucket.withSSECustomerKey
(SSECustomerKey sseKey) Sets the optional customer-provided server-side encryption key to use to encrypt the object part being uploaded, and returns the updated request object so that additional method calls can be chained together.withUploadId
(String uploadId) Sets the ID of the existing, initiated multipart upload with which this new part will be associated, and returns this updated UploadPartRequest object so that additional method calls can be chained together.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
-
UploadPartRequest
public UploadPartRequest()
-
-
Method Details
-
setInputStream
Sets the stream containing the data to upload for the new part.- Specified by:
setInputStream
in interfaceS3DataSource
- Parameters:
inputStream
- the stream containing the data to upload for the new part.
-
getInputStream
Returns the stream containing the data to upload for the new part.- Specified by:
getInputStream
in interfaceS3DataSource
- Returns:
- the stream containing the data to upload for the new part.
-
withInputStream
Sets the stream containing the data to upload for the new part, and returns this updated object so that additional method calls can be chained together.- Parameters:
inputStream
- the stream containing the data to upload for the new part.- Returns:
- The updated UploadPartRequest object.
-
getBucketName
Returns the name of the bucket containing the existing, initiated multipart upload, with which this new part will be associated.- Returns:
- the name of the bucket containing the existing, initiated multipart upload, with which this new part will be associated.
-
setBucketName
Sets the name of the bucket containing the existing, initiated multipart upload, with which this new part will be associated.- Parameters:
bucketName
- the name of the bucket containing the existing, initiated multipart upload, with which this new part will be associated.
-
withBucketName
Sets the name of the bucket containing the existing, initiated multipart upload, with which this new part will be associated, and returns this updated object so that additional method calls can be chained together.- Parameters:
bucketName
- the name of the bucket containing the existing, initiated multipart upload, with which this new part will be associated.- Returns:
- This updated UploadPartRequest object.
-
getKey
Returns the key of the initiated multipart upload.- Returns:
- the key of the initiated multipart upload.
-
setKey
Sets the key of the initiated multipart upload.- Parameters:
key
- the key of the initiated multipart upload.
-
withKey
Sets the key of the initiated multipart upload, and returns this updated object so that additional method calls can be chained together.- Parameters:
key
- the key of the initiated multipart upload.- Returns:
- This updated UploadPartRequest object.
-
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, and returns this updated UploadPartRequest object so that additional method calls can be chained together.- Parameters:
uploadId
- the ID of the existing, initiated multipart upload with which this new part will be associated.- Returns:
- This updated UploadPartRequest object.
-
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).Returns this updated UploadPartRequest object so that additional method calls can be chained together.
- 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 updated UploadPartRequest object.
-
getPartSize
public long getPartSize()Returns the size of this part, in bytes.- Returns:
- the size of this part, in bytes.
-
setPartSize
public void setPartSize(long partSize) Sets the size of this part, in bytes.- Parameters:
partSize
- the size of this part, in bytes.
-
withPartSize
Sets the size of this part, in bytes, and returns this updated UploadPartRequest object so that additional method calls can be chained together.- Parameters:
partSize
- the size of this part, in bytes.- Returns:
- This updated UploadPartRequest object.
-
getMd5Digest
Returns the optional, but recommended, MD5 hash of the content of this part. If specified, this value will be sent to Amazon S3 to verify the data integrity when the data reaches Amazon S3.- Returns:
- The optional, but recommended, MD5 hash of the content of this part. If specified, this value will be sent to Amazon S3 to verify the data integrity when the data reaches Amazon S3.
-
setMd5Digest
Sets the optional, but recommended, MD5 hash of the content of this part. If specified, this value will be sent to Amazon S3 to verify the data integrity when the data reaches Amazon S3.- Parameters:
md5Digest
- The optional, but recommended, MD5 hash of the content of this part. If specified, this value will be sent to Amazon S3 to verify the data integrity when the data reaches Amazon S3.
-
withMD5Digest
Sets the optional, but recommended, MD5 hash of the content of this part. If specified, this value will be sent to Amazon S3 to verify the data integrity when the data reaches Amazon S3.Returns this updated UploadPartRequest object so that additional method calls can be chained together.
- Parameters:
md5Digest
- The optional, but recommended, MD5 hash of the content of this part. If specified, this value will be sent to Amazon S3 to verify the data integrity when the data reaches Amazon S3.- Returns:
- This updated UploadPartRequest object.
-
getFile
Returns the file containing the data to upload. Exactly one File or InputStream must be specified as the input to this operation.- Specified by:
getFile
in interfaceS3DataSource
- Returns:
- The file containing the data to upload. Exactly one File or InputStream must be specified as the input to this operation.
-
setFile
Sets the file containing the data to upload. Exactly one File or InputStream must be specified as the input to this operation.- Specified by:
setFile
in interfaceS3DataSource
- Parameters:
file
- The file containing the data to upload. Exactly one File or InputStream must be specified as the input to this operation.
-
withFile
Sets the file containing the data to upload, and returns this updated UploadPartRequest object so that additional method calls can be chained together.Exactly one File or InputStream must be specified as the input to this operation.
- Parameters:
file
- The file containing the data to upload. Exactly one File or InputStream must be specified as the input to this operation.- Returns:
- This updated UploadPartRequest object.
-
getFileOffset
public long getFileOffset()Returns the optional offset in the specified file, at which to begin uploading data for this part. If not specified, data will be read from the beginning of the file.- Returns:
- The optional offset in the specified file, at which to begin uploading data for this part. If not specified, data will be read from the beginning of the file.
-
setFileOffset
public void setFileOffset(long fileOffset) Sets the optional offset in the specified file, at which to begin uploading data for this part. If not specified, data will be read from the beginning of the file.- Parameters:
fileOffset
- The optional offset in the specified file, at which to begin uploading data for this part. If not specified, data will be read from the beginning of the file.
-
withFileOffset
Sets the optional offset in the specified file, at which to begin uploading data for this part, and returns this updated UploadPartRequest object so that additional method calls can be chained together.If not specified, data will be read from the beginning of the file.
- Parameters:
fileOffset
- The optional offset in the specified file, at which to begin uploading data for this part. If not specified, data will be read from the beginning of the file.- Returns:
- This updated UploadPartRequest object.
-
setProgressListener
Deprecated.Sets the optional progress listener for receiving updates about object upload status.- Parameters:
progressListener
- The legacy progress listener that is used exclusively for Amazon S3 client.
-
getProgressListener
Deprecated.useAmazonWebServiceRequest.getGeneralProgressListener()
instead.Returns the optional progress listener for receiving updates about object upload status.- Returns:
- the optional progress listener for receiving updates about object upload status.
-
withProgressListener
Deprecated.Sets the optional progress listener for receiving updates about object upload status, and returns this updated object so that additional method calls can be chained together.- Parameters:
progressListener
- The legacy progress listener that is used exclusively for Amazon S3 client.- Returns:
- This updated UploadPartRequest object.
-
isLastPart
public boolean isLastPart()Returns true if the creator of this request has indicated this part is the last part being uploaded in a multipart upload.- Returns:
- True if the creator of this request has indicated this part is the last part being uploaded in a multipart upload.
-
setLastPart
public void setLastPart(boolean isLastPart) Marks this part as the last part being uploaded in a multipart upload.- Parameters:
isLastPart
- Whether or not this is the last part being uploaded in a multipart upload.
-
withLastPart
Marks this part as the last part being uploaded in a multipart upload, and returns this updated request object so that additional method calls can be chained together.- Parameters:
isLastPart
- Whether or not this is the last part being uploaded in a multipart upload.- Returns:
- This updated request object so that additional method calls can be chained together.
-
getSSECustomerKey
Description copied from interface:SSECustomerKeyProvider
Returns the optional customer-provided server-side encryption key to use to encrypt the uploaded object.- Specified by:
getSSECustomerKey
in interfaceSSECustomerKeyProvider
- Returns:
- The optional customer-provided server-side encryption key to use to encrypt the uploaded object.
-
setSSECustomerKey
Sets the optional customer-provided server-side encryption key to use to encrypt the object part being uploaded.- Parameters:
sseKey
- The optional customer-provided server-side encryption key to use to encrypt the object part being uploaded.
-
withSSECustomerKey
Sets the optional customer-provided server-side encryption key to use to encrypt the object part being uploaded, 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 object part being uploaded.- Returns:
- This updated request object so that additional method calls can be chained together.
-
getObjectMetadata
Returns the additional information about the part being uploaded. -
setObjectMetadata
Sets the additional information about the part being uploaded. -
withObjectMetadata
Fluent API forsetObjectMetadata(ObjectMetadata)
. -
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 UploadPartRequest 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 UploadPartRequest object.
-
AmazonWebServiceRequest.getGeneralProgressListener()
instead.