Class InitiateMultipartUploadRequest
- java.lang.Object
-
- com.amazonaws.AmazonWebServiceRequest
-
- com.amazonaws.services.s3.model.InitiateMultipartUploadRequest
-
- All Implemented Interfaces:
ReadLimitInfo
,SSEAwsKeyManagementParamsProvider
,SSECustomerKeyProvider
,Serializable
,Cloneable
- Direct Known Subclasses:
EncryptedInitiateMultipartUploadRequest
public class InitiateMultipartUploadRequest extends AmazonWebServiceRequest implements SSECustomerKeyProvider, SSEAwsKeyManagementParamsProvider, Serializable
The InitiateMultipartUploadRequest contains the parameters used for the InitiateMultipartUpload method.If you are initiating multipart upload 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
-
-
Field Summary
Fields Modifier and Type Field Description ObjectMetadata
objectMetadata
Additional information about the new object being created, such as content type, content encoding, user metadata, etc.-
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
-
Constructor Summary
Constructors Constructor Description InitiateMultipartUploadRequest(String bucketName, String key)
Constructs a request to initiate a new multipart upload in the specified bucket, stored by the specified key.InitiateMultipartUploadRequest(String bucketName, String key, ObjectMetadata objectMetadata)
Constructs a request to initiate a new multipart upload in the specified bucket, stored by the specified key, and with the additional specified object metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessControlList
getAccessControlList()
Returns the optional access control list for the new upload.String
getBucketName()
Returns the name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.CannedAccessControlList
getCannedACL()
Returns the optional canned Access Control List (ACL) to set permissions for the new object created when the multipart upload is completed.String
getKey()
Returns the key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.ObjectMetadata
getObjectMetadata()
Returns the additional information about the new object being created, such as content type, content encoding, user metadata, etc.String
getRedirectLocation()
Gets the optional redirect location for the new object.SSEAwsKeyManagementParams
getSSEAwsKeyManagementParams()
Returns the AWS Key Management System parameters used to encrypt the object on server side.SSECustomerKey
getSSECustomerKey()
Returns the optional customer-provided server-side encryption key to use to encrypt the uploaded object.StorageClass
getStorageClass()
Returns the optional storage class to use when storing this upload's data in S3.boolean
isRequesterPays()
Returns true if the user has enabled Requester Pays option when conducting this operation from Requester Pays Bucket; else false.void
setAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new upload.void
setBucketName(String bucketName)
Sets the name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.void
setCannedACL(CannedAccessControlList cannedACL)
Sets the optional canned Access Control List (ACL) to set permissions for the new object created when the multipart upload is completed.void
setKey(String key)
Sets the key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.void
setObjectMetadata(ObjectMetadata objectMetadata)
Sets the additional information about the new object being created, such as content type, content encoding, user metadata, etc.void
setRedirectLocation(String redirectLocation)
Sets the optional redirect location for the new object.void
setRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.void
setSSEAwsKeyManagementParams(SSEAwsKeyManagementParams params)
Sets the AWS Key Management System parameters used to encrypt the object on server side.void
setSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to encrypt the upload being started.void
setStorageClass(StorageClass storageClass)
Sets the optional storage class to use when storing this upload's data in S3.InitiateMultipartUploadRequest
withAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new upload.InitiateMultipartUploadRequest
withBucketName(String bucketName)
Sets the name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.InitiateMultipartUploadRequest
withCannedACL(CannedAccessControlList acl)
Sets the optional canned Access Control List (ACL) to set permissions for the new object created when the multipart upload is completed.InitiateMultipartUploadRequest
withKey(String key)
Sets the key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.InitiateMultipartUploadRequest
withObjectMetadata(ObjectMetadata objectMetadata)
Sets the additional information about the new object being created, such as content type, content encoding, user metadata, etc.InitiateMultipartUploadRequest
withRedirectLocation(String redirectLocation)
Sets the optional redirect location for the new object.InitiateMultipartUploadRequest
withRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.InitiateMultipartUploadRequest
withSSEAwsKeyManagementParams(SSEAwsKeyManagementParams sseAwsKeyManagementParams)
Sets the AWS Key Management System parameters used to encrypt the object on server side.InitiateMultipartUploadRequest
withSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to encrypt the upload being started, and returns the updated InitiateMultipartUploadRequest so that additional method calls may be chained together.InitiateMultipartUploadRequest
withStorageClass(StorageClass storageClass)
Sets the optional storage class to use when storing this upload's data in S3.InitiateMultipartUploadRequest
withStorageClass(String storageClass)
-
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
-
-
-
-
Field Detail
-
objectMetadata
public ObjectMetadata objectMetadata
Additional information about the new object being created, such as content type, content encoding, user metadata, etc.
-
-
Constructor Detail
-
InitiateMultipartUploadRequest
public InitiateMultipartUploadRequest(String bucketName, String key)
Constructs a request to initiate a new multipart upload in the specified bucket, stored by the specified key.- Parameters:
bucketName
- The name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.key
- The key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.
-
InitiateMultipartUploadRequest
public InitiateMultipartUploadRequest(String bucketName, String key, ObjectMetadata objectMetadata)
Constructs a request to initiate a new multipart upload in the specified bucket, stored by the specified key, and with the additional specified object metadata.- Parameters:
bucketName
- The name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.key
- The key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.objectMetadata
- Additional information about the new object being created, such as content type, content encoding, user metadata, etc.
-
-
Method Detail
-
getBucketName
public String getBucketName()
Returns the name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.- Returns:
- The name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.
-
setBucketName
public void setBucketName(String bucketName)
Sets the name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.- Parameters:
bucketName
- The name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.
-
withBucketName
public InitiateMultipartUploadRequest withBucketName(String bucketName)
Sets the name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.Returns this updated InitiateMultipartUploadRequest object so that additional method calls can be chained together.
- Parameters:
bucketName
- The name of the bucket in which to create the new multipart upload, and hence, the eventual object created from the multipart upload.- Returns:
- This updated InitiateMultipartUploadRequest object.
-
getKey
public String getKey()
Returns the key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.- Returns:
- The key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.
-
setKey
public void setKey(String key)
Sets the key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.- Parameters:
key
- The key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.
-
withKey
public InitiateMultipartUploadRequest withKey(String key)
Sets the key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.Returns this updated InitiateMultipartUploadRequest object so that additional method calls can be chained together.
- Parameters:
key
- The key by which to store the new multipart upload, and hence, the eventual object created from the multipart upload.- Returns:
- This updated InitiateMultipartUploadRequest object.
-
getCannedACL
public CannedAccessControlList getCannedACL()
Returns the optional canned Access Control List (ACL) to set permissions for the new object created when the multipart upload is completed.- Returns:
- The optional canned Access Control List (ACL) to set permissions for the new object created when the multipart upload is completed.
- See Also:
CannedAccessControlList
-
setCannedACL
public void setCannedACL(CannedAccessControlList cannedACL)
Sets the optional canned Access Control List (ACL) to set permissions for the new object created when the multipart upload is completed.- Parameters:
cannedACL
- The canned Access Control List (ACL) to set permissions for the new object created when the multipart upload is completed.- See Also:
CannedAccessControlList
-
withCannedACL
public InitiateMultipartUploadRequest withCannedACL(CannedAccessControlList acl)
Sets the optional canned Access Control List (ACL) to set permissions for the new object created when the multipart upload is completed.Returns this updated InitiateMultipartUploadRequest object so that additional method calls can be chained together.
- Parameters:
acl
- The optional canned Access Control List (ACL) to set permissions for the new object created when the multipart upload is completed.- Returns:
- This updated InitiateMultipartUploadRequest object.
-
getAccessControlList
public AccessControlList getAccessControlList()
Returns the optional access control list for the new upload. If specified, cannedAcl will be ignored.
-
setAccessControlList
public void setAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new upload. If specified, cannedAcl will be ignored.- Parameters:
accessControlList
- The access control list for the new upload.
-
withAccessControlList
public InitiateMultipartUploadRequest withAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new upload. If specified, cannedAcl will be ignored. Returns thisInitiateMultipartUploadRequest
, enabling additional method calls to be chained together.- Parameters:
accessControlList
- The access control list for the new upload.
-
getStorageClass
public StorageClass getStorageClass()
Returns the optional storage class to use when storing this upload's data in S3. If not specified, the default storage class is used.If not specified, the default is
StorageClass.Standard
.- Returns:
- The optional storage class to use when storing this upload's data in S3. If not specified, the default storage class is used.
- See Also:
StorageClass
-
setStorageClass
public void setStorageClass(StorageClass storageClass)
Sets the optional storage class to use when storing this upload's data in S3. If not specified, the default storage class is used.If not specified, the default is
StorageClass.Standard
.- Parameters:
storageClass
- The optional storage class to use when storing this upload's data in S3. If not specified, the default storage class is used.- See Also:
StorageClass
-
withStorageClass
public InitiateMultipartUploadRequest withStorageClass(StorageClass storageClass)
Sets the optional storage class to use when storing this upload's data in S3. If not specified, the default storage class is used.Returns this updated InitiateMultipartUploadRequest object so that additional method calls can be chained together.
- Parameters:
storageClass
- The optional storage class to use when storing this upload's data in S3. If not specified, the default storage class is used.- Returns:
- This updated InitiateMultipartUploadRequest object.
-
withStorageClass
public InitiateMultipartUploadRequest withStorageClass(String storageClass)
-
getObjectMetadata
public ObjectMetadata getObjectMetadata()
Returns the additional information about the new object being created, such as content type, content encoding, user metadata, etc.- Returns:
- The additional information about the new object being created, such as content type, content encoding, user metadata, etc.
-
setObjectMetadata
public void setObjectMetadata(ObjectMetadata objectMetadata)
Sets the additional information about the new object being created, such as content type, content encoding, user metadata, etc.- Parameters:
objectMetadata
- Additional information about the new object being created, such as content type, content encoding, user metadata, etc.
-
withObjectMetadata
public InitiateMultipartUploadRequest withObjectMetadata(ObjectMetadata objectMetadata)
Sets the additional information about the new object being created, such as content type, content encoding, user metadata, etc.Returns this updated InitiateMultipartUploadRequest object so that additional method calls can be chained together.
- Parameters:
objectMetadata
- Additional information about the new object being created, such as content type, content encoding, user metadata, etc.- Returns:
- This updated InitiateMultipartUploadRequest object.
-
setRedirectLocation
public void setRedirectLocation(String redirectLocation)
Sets the optional redirect location for the new object.- Parameters:
redirectLocation
- The redirect location for the new object.
-
getRedirectLocation
public String getRedirectLocation()
Gets the optional redirect location for the new object.
-
withRedirectLocation
public InitiateMultipartUploadRequest withRedirectLocation(String redirectLocation)
Sets the optional redirect location for the new object. Returns thisInitiateMultipartUploadRequest
, enabling additional method calls to be chained together.- Parameters:
redirectLocation
- The redirect location for the new object.
-
getSSECustomerKey
public SSECustomerKey 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
public void setSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to encrypt the upload being started.- Parameters:
sseKey
- The optional customer-provided server-side encryption key to use to encrypt the upload being started.
-
withSSECustomerKey
public InitiateMultipartUploadRequest withSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to encrypt the upload being started, and returns the updated InitiateMultipartUploadRequest so that additional method calls may be chained together.- Parameters:
sseKey
- The optional customer-provided server-side encryption key to use to encrypt the upload being started.- Returns:
- The updated request object, so that additional method calls can be chained together.
-
getSSEAwsKeyManagementParams
public SSEAwsKeyManagementParams 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
public void setSSEAwsKeyManagementParams(SSEAwsKeyManagementParams params)
Sets the AWS Key Management System parameters used to encrypt the object on server side.
-
withSSEAwsKeyManagementParams
public InitiateMultipartUploadRequest withSSEAwsKeyManagementParams(SSEAwsKeyManagementParams sseAwsKeyManagementParams)
Sets the AWS Key Management System parameters used to encrypt the object on server side.- Returns:
- returns the update InitiateMultipartUploadRequest
-
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
public InitiateMultipartUploadRequest withRequesterPays(boolean isRequesterPays)
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 InitiateMultipartUploadRequest 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 InitiateMultipartUploadRequest object.
-
-