public class UploadPartRequest extends AmazonWebServiceRequest implements SSECustomerKeyProvider, S3DataSource, java.io.Serializable
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
S3DataSource.Utils
Constructor and Description |
---|
UploadPartRequest() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBucketName()
Returns the name of the bucket containing the existing, initiated
multipart upload, with which this new part will be associated.
|
java.io.File |
getFile()
Returns the file containing the data to upload.
|
long |
getFileOffset()
Returns the optional offset in the specified file, at which to begin
uploading data for this part.
|
int |
getId() |
java.io.InputStream |
getInputStream()
Returns the stream containing the data to upload for the new part.
|
java.lang.String |
getKey()
Returns the key of the initiated multipart upload.
|
int |
getMainUploadId() |
java.lang.String |
getMd5Digest()
Returns the optional, but recommended, MD5 hash of the content of this
part.
|
ObjectMetadata |
getObjectMetadata()
Returns the additional information about the part being uploaded.
|
int |
getPartNumber()
Returns the part number describing this part's position relative to the
other parts in the multipart upload.
|
long |
getPartSize()
Returns the size of this part, in bytes.
|
ProgressListener |
getProgressListener()
Deprecated.
use
AmazonWebServiceRequest.getGeneralProgressListener() instead. |
SSECustomerKey |
getSSECustomerKey()
Returns the optional customer-provided server-side encryption key to use
to encrypt the uploaded object.
|
java.lang.String |
getUploadId()
Returns the ID of the existing, initiated multipart upload with which
this new part will be associated.
|
boolean |
isLastPart()
Returns true if the creator of this request has indicated this part is
the last part being uploaded in a multipart upload.
|
boolean |
isRequesterPays()
Returns true if the user has enabled Requester Pays option when
conducting this operation from Requester Pays Bucket; else false.
|
void |
setBucketName(java.lang.String bucketName)
Sets the name of the bucket containing the existing, initiated multipart
upload, with which this new part will be associated.
|
void |
setFile(java.io.File file)
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 |
setId(int id) |
void |
setInputStream(java.io.InputStream inputStream)
Sets the stream containing the data to upload for the new part.
|
void |
setKey(java.lang.String key)
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 |
setMainUploadId(int id) |
void |
setMd5Digest(java.lang.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(java.lang.String uploadId)
Sets the ID of the existing, initiated multipart upload with which this
new part will be associated.
|
UploadPartRequest |
withBucketName(java.lang.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.
|
UploadPartRequest |
withFile(java.io.File file)
Sets the file containing the data to upload, and returns this updated
UploadPartRequest object so that additional method calls can be chained
together.
|
UploadPartRequest |
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.
|
UploadPartRequest |
withId(int id) |
UploadPartRequest |
withInputStream(java.io.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.
|
UploadPartRequest |
withKey(java.lang.String key)
Sets the key of the initiated multipart upload, and returns this updated
object so that additional method calls can be chained together.
|
UploadPartRequest |
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.
|
UploadPartRequest |
withMainUploadId(int id) |
UploadPartRequest |
withMD5Digest(java.lang.String md5Digest)
Sets the optional, but recommended, MD5 hash of the content of this part.
|
UploadPartRequest |
withObjectMetadata(ObjectMetadata objectMetadata)
Fluent API for
setObjectMetadata(ObjectMetadata) . |
UploadPartRequest |
withPartNumber(int partNumber)
Sets the part number describing this part's position relative to the
other parts in the multipart upload.
|
UploadPartRequest |
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.
|
UploadPartRequest |
withProgressListener(ProgressListener progressListener)
Deprecated.
|
UploadPartRequest |
withRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
UploadPartRequest |
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.
|
UploadPartRequest |
withUploadId(java.lang.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.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public void setId(int id)
id
- the transfer id of the upload partpublic int getId()
public UploadPartRequest withId(int id)
id
- the transfer id of the upload partpublic void setMainUploadId(int id)
id
- The transfer id of the main upload record of this upload partpublic int getMainUploadId()
public UploadPartRequest withMainUploadId(int id)
id
- The transfer id of the main upload record of this upload partpublic void setInputStream(java.io.InputStream inputStream)
setInputStream
in interface S3DataSource
inputStream
- the stream containing the data to upload for the new
part.public java.io.InputStream getInputStream()
getInputStream
in interface S3DataSource
public UploadPartRequest withInputStream(java.io.InputStream inputStream)
inputStream
- the stream containing the data to upload for the new
part.public java.lang.String getBucketName()
public void setBucketName(java.lang.String bucketName)
bucketName
- the name of the bucket containing the existing,
initiated multipart upload, with which this new part will be
associated.public UploadPartRequest withBucketName(java.lang.String bucketName)
bucketName
- the name of the bucket containing the existing,
initiated multipart upload, with which this new part will be
associated.public java.lang.String getKey()
public void setKey(java.lang.String key)
key
- the key of the initiated multipart upload.public UploadPartRequest withKey(java.lang.String key)
key
- the key of the initiated multipart upload.public java.lang.String getUploadId()
public void setUploadId(java.lang.String uploadId)
uploadId
- the ID of the existing, initiated multipart upload with
which this new part will be associated.public UploadPartRequest withUploadId(java.lang.String uploadId)
uploadId
- the ID of the existing, initiated multipart upload with
which this new part will be associated.public int getPartNumber()
public void setPartNumber(int partNumber)
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).public UploadPartRequest withPartNumber(int partNumber)
Returns this updated UploadPartRequest object so that additional method calls can be chained together.
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).public long getPartSize()
public void setPartSize(long partSize)
partSize
- the size of this part, in bytes.public UploadPartRequest withPartSize(long partSize)
partSize
- the size of this part, in bytes.public java.lang.String getMd5Digest()
public void setMd5Digest(java.lang.String md5Digest)
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.public UploadPartRequest withMD5Digest(java.lang.String md5Digest)
Returns this updated UploadPartRequest object so that additional method calls can be chained together.
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.public java.io.File getFile()
getFile
in interface S3DataSource
public void setFile(java.io.File file)
setFile
in interface S3DataSource
file
- The file containing the data to upload. Exactly one File or
InputStream must be specified as the input to this operation.public UploadPartRequest withFile(java.io.File file)
Exactly one File or InputStream must be specified as the input to this operation.
file
- The file containing the data to upload. Exactly one File or
InputStream must be specified as the input to this operation.public long getFileOffset()
public void setFileOffset(long fileOffset)
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.public UploadPartRequest withFileOffset(long fileOffset)
If not specified, data will be read from the beginning of the file.
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.@Deprecated public void setProgressListener(ProgressListener progressListener)
AmazonWebServiceRequest.setGeneralProgressListener(ProgressListener)
instead.progressListener
- The legacy progress listener that is used
exclusively for Amazon S3 client.@Deprecated public ProgressListener getProgressListener()
AmazonWebServiceRequest.getGeneralProgressListener()
instead.@Deprecated public UploadPartRequest withProgressListener(ProgressListener progressListener)
AmazonWebServiceRequest.withGeneralProgressListener(ProgressListener)
instead.progressListener
- The legacy progress listener that is used
exclusively for Amazon S3 client.public boolean isLastPart()
public void setLastPart(boolean isLastPart)
isLastPart
- Whether or not this is the last part being uploaded in
a multipart upload.public UploadPartRequest withLastPart(boolean isLastPart)
isLastPart
- Whether or not this is the last part being uploaded in
a multipart upload.public SSECustomerKey getSSECustomerKey()
SSECustomerKeyProvider
getSSECustomerKey
in interface SSECustomerKeyProvider
public void setSSECustomerKey(SSECustomerKey sseKey)
sseKey
- The optional customer-provided server-side encryption key
to use to encrypt the object part being uploaded.public UploadPartRequest withSSECustomerKey(SSECustomerKey sseKey)
sseKey
- The optional customer-provided server-side encryption key
to use to encrypt the object part being uploaded.public ObjectMetadata getObjectMetadata()
public void setObjectMetadata(ObjectMetadata objectMetadata)
public UploadPartRequest withObjectMetadata(ObjectMetadata objectMetadata)
setObjectMetadata(ObjectMetadata)
.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 UploadPartRequest 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.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.