public abstract class AbstractPutObjectRequest extends AmazonWebServiceRequest implements SSECustomerKeyProvider, SSEAwsKeyManagementParamsProvider, S3DataSource, java.io.Serializable
S3DataSource.Utils
Constructor and Description |
---|
AbstractPutObjectRequest(java.lang.String bucketName,
java.lang.String key,
java.io.File file)
Constructs a new
AbstractPutObjectRequest object to upload a file
to the specified bucket and key. |
AbstractPutObjectRequest(java.lang.String bucketName,
java.lang.String key,
java.lang.String redirectLocation)
Constructs a new
AbstractPutObjectRequest object with redirect
location. |
Modifier and Type | Method and Description |
---|---|
AbstractPutObjectRequest |
clone()
Creates a shallow clone of this request.
|
AccessControlList |
getAccessControlList()
Returns the optional access control list for the new object.
|
java.lang.String |
getBucketName()
Gets the name of the existing bucket where this request will upload a new
object to.
|
CannedAccessControlList |
getCannedAcl()
Gets the optional pre-configured access control policy to use for the new
object.
|
java.io.File |
getFile()
Gets the path and name of the file containing the data to be uploaded to
Amazon S3.
|
java.io.InputStream |
getInputStream()
Gets the input stream containing the data to be uploaded to Amazon S3.
|
java.lang.String |
getKey()
Gets the key under which to store the new object.
|
ObjectMetadata |
getMetadata()
Gets the optional metadata instructing Amazon S3 how to handle the
uploaded data (e.g.
|
ProgressListener |
getProgressListener()
Deprecated.
use
AmazonWebServiceRequest.getGeneralProgressListener() instead. |
java.lang.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.
|
java.lang.String |
getStorageClass()
Gets the optional Amazon S3 storage class to use when storing the new
object.
|
ObjectTagging |
getTagging()
Gets the object tagging associated with this request.
|
void |
setAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new object.
|
void |
setBucketName(java.lang.String bucketName)
Sets the name of an existing bucket where this request will upload a new
object to.
|
void |
setCannedAcl(CannedAccessControlList cannedAcl)
Sets the optional pre-configured access control policy to use for the new
object.
|
void |
setFile(java.io.File file)
Sets the path and name of the file containing the data to be uploaded to
Amazon S3.
|
void |
setInputStream(java.io.InputStream inputStream)
Sets the input stream containing the data to be uploaded to Amazon S3.
|
void |
setKey(java.lang.String key)
Sets the key under which to store the new object.
|
void |
setMetadata(ObjectMetadata metadata)
Sets the optional metadata instructing Amazon S3 how to handle the
uploaded data (e.g.
|
void |
setProgressListener(ProgressListener progressListener)
Deprecated.
|
void |
setRedirectLocation(java.lang.String redirectLocation)
Sets the optional redirect location for the new object.
|
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 uploaded object.
|
void |
setStorageClass(StorageClass storageClass)
Sets the optional Amazon S3 storage class to use when storing the new
object.
|
void |
setStorageClass(java.lang.String storageClass)
Sets the optional Amazon S3 storage class to use when storing the new
object.
|
void |
setTagging(ObjectTagging tagging)
Attaches object tagging to this request.
|
<T extends AbstractPutObjectRequest> |
withAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new object.
|
<T extends AbstractPutObjectRequest> |
withBucketName(java.lang.String bucketName)
Sets the name of the bucket where this request will upload a new object
to.
|
<T extends AbstractPutObjectRequest> |
withCannedAcl(CannedAccessControlList cannedAcl)
Sets the optional pre-configured access control policy to use for the new
object.
|
<T extends AbstractPutObjectRequest> |
withFile(java.io.File file)
Sets the file containing the data to be uploaded to Amazon S3.
|
<T extends AbstractPutObjectRequest> |
withInputStream(java.io.InputStream inputStream)
Sets the input stream containing the data to be uploaded to Amazon S3.
|
<T extends AbstractPutObjectRequest> |
withKey(java.lang.String key)
Sets the key under which to store the new object.
|
<T extends AbstractPutObjectRequest> |
withMetadata(ObjectMetadata metadata)
Sets the optional metadata instructing Amazon S3 how to handle the
uploaded data (e.g.
|
<T extends AbstractPutObjectRequest> |
withProgressListener(ProgressListener progressListener)
Deprecated.
|
<T extends AbstractPutObjectRequest> |
withRedirectLocation(java.lang.String redirectLocation)
Sets the optional redirect location for the new object.Returns this
AbstractPutObjectRequest , enabling additional method calls to be
chained together. |
<T extends AbstractPutObjectRequest> |
withSSEAwsKeyManagementParams(SSEAwsKeyManagementParams sseAwsKeyManagementParams)
Sets the AWS Key Management System parameters used to encrypt the object
on server side.
|
<T extends AbstractPutObjectRequest> |
withSSECustomerKey(SSECustomerKey sseKey)
Sets the optional customer-provided server-side encryption key to use to
encrypt the uploaded object, and returns the updated request object so
that additional method calls can be chained together.
|
<T extends AbstractPutObjectRequest> |
withStorageClass(StorageClass storageClass)
Sets the optional Amazon S3 storage class to use when storing the new
object.
|
<T extends AbstractPutObjectRequest> |
withStorageClass(java.lang.String storageClass)
Sets the optional Amazon S3 storage class to use when storing the new
object.
|
<T extends AbstractPutObjectRequest> |
withTagging(ObjectTagging tagSet)
Sets tagging for this request.
|
getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public AbstractPutObjectRequest(java.lang.String bucketName, java.lang.String key, java.io.File file)
AbstractPutObjectRequest
object to upload a file
to the specified bucket and key. After constructing the request, users
may optionally specify object metadata or a canned ACL as well.bucketName
- The name of an existing bucket to which the new object
will be uploaded.key
- The key under which to store the new object.file
- The path of the file to upload to Amazon S3.public AbstractPutObjectRequest(java.lang.String bucketName, java.lang.String key, java.lang.String redirectLocation)
AbstractPutObjectRequest
object with redirect
location. After constructing the request, users may optionally specify
object metadata or a canned ACL as well.bucketName
- The name of an existing bucket to which the new object
will be uploaded.key
- The key under which to store the new object.redirectLocation
- The redirect location of this new object.public java.lang.String getBucketName()
Permission.Write
permission granted.setBucketName(String)
,
withBucketName(String)
public void setBucketName(java.lang.String bucketName)
Permission.Write
permission granted.bucketName
- The name of an existing bucket where this request will
upload a new object to. In order to upload the object, users
must have Permission.Write
permission granted.getBucketName()
,
withBucketName(String)
public <T extends AbstractPutObjectRequest> T withBucketName(java.lang.String bucketName)
In order to upload the object, users must have Permission.Write
permission granted.
bucketName
- The name of an existing bucket where this request will
upload a new object to. In order to upload the object, users
must have Permission.Write
permission granted.AbstractPutObjectRequest
, enabling additional method
calls to be chained together.getBucketName()
,
setBucketName(String)
public java.lang.String getKey()
setKey(String)
,
withKey(String)
public void setKey(java.lang.String key)
key
- The key under which to store the new object.getKey()
,
withKey(String)
public <T extends AbstractPutObjectRequest> T withKey(java.lang.String key)
key
- The key under which to store the new object.AbstractPutObjectRequest
, enabling additional method
calls to be chained together.getKey()
,
setKey(String)
public java.lang.String getStorageClass()
For more information on available Amazon S3 storage classes, see the
StorageClass
enumeration.
setStorageClass(String)
,
setStorageClass(StorageClass)
,
withStorageClass(StorageClass)
,
withStorageClass(String)
public void setStorageClass(java.lang.String storageClass)
For more information on Amazon S3 storage classes and available values,
see the StorageClass
enumeration.
storageClass
- The storage class to use when storing the new object.getStorageClass()
,
setStorageClass(String)
,
withStorageClass(StorageClass)
,
withStorageClass(String)
public <T extends AbstractPutObjectRequest> T withStorageClass(java.lang.String storageClass)
AbstractPutObjectRequest
, enabling
additional method calls to be chained together. If not specified, the
default standard storage class will be used when storing the object.
For more information on Amazon S3 storage classes and available values,
see the StorageClass
enumeration.
storageClass
- The storage class to use when storing the new object.AbstractPutObjectRequest
, enabling additional method
calls to be chained together.getStorageClass()
,
setStorageClass(StorageClass)
,
setStorageClass(String)
,
withStorageClass(StorageClass)
public void setStorageClass(StorageClass storageClass)
For more information on Amazon S3 storage classes and available values,
see the StorageClass
enumeration.
storageClass
- The storage class to use when storing the new object.getStorageClass()
,
setStorageClass(String)
public <T extends AbstractPutObjectRequest> T withStorageClass(StorageClass storageClass)
AbstractPutObjectRequest
, enabling
additional method calls to be chained together. If not specified, the
default standard storage class will be used when storing the object.
For more information on Amazon S3 storage classes and available values,
see the StorageClass
enumeration.
storageClass
- The storage class to use when storing the new object.AbstractPutObjectRequest
, enabling additional method
calls to be chained together.getStorageClass()
,
setStorageClass(StorageClass)
,
setStorageClass(String)
,
withStorageClass(String)
public java.io.File getFile()
getFile
in interface S3DataSource
setFile(File)
,
withFile(File)
,
setInputStream(InputStream)
,
withInputStream(InputStream)
public void setFile(java.io.File file)
setFile
in interface S3DataSource
file
- The path and name of the file containing the data to be
uploaded to Amazon S3.getFile()
,
withFile(File)
,
getInputStream()
,
withInputStream(InputStream)
public <T extends AbstractPutObjectRequest> T withFile(java.io.File file)
AbstractPutObjectRequest
, enabling additional method calls
to be chained together.
Either specify a file or an input stream containing the data to be uploaded to Amazon S3; both cannot be specified.
file
- The file containing the data to be uploaded to Amazon S3.AbstractPutObjectRequest
, enabling additional method
calls to be chained together.getFile()
,
setFile(File)
,
getInputStream()
,
setInputStream(InputStream)
public ObjectMetadata getMetadata()
If uploading from an input stream, always specify metadata with the content size set. Otherwise the contents of the input stream have to be buffered in memory before being sent to Amazon S3. This can cause very negative performance impacts.
setMetadata(ObjectMetadata)
,
withMetadata(ObjectMetadata)
public void setMetadata(ObjectMetadata metadata)
If uploading from an input stream, always specify metadata with the content size set. Otherwise the contents of the input stream have to be buffered in memory before being sent to Amazon S3. This can cause very negative performance impacts.
metadata
- The optional metadata instructing Amazon S3 how to handle
the uploaded data (e.g. custom user metadata, hooks for
specifying content type, etc.).getMetadata()
,
withMetadata(ObjectMetadata)
public <T extends AbstractPutObjectRequest> T withMetadata(ObjectMetadata metadata)
AbstractPutObjectRequest
, enabling
additional method calls to be chained together.
If uploading from an input stream, always specify metadata with the content size set. Otherwise the contents of the input stream have to be buffered in memory before being sent to Amazon S3. This can cause very negative performance impacts.
metadata
- The optional metadata instructing Amazon S3 how to handle
the uploaded data (e.g. custom user metadata, hooks for
specifying content type, etc.).AbstractPutObjectRequest
, enabling additional method
calls to be chained together.getMetadata()
,
setMetadata(ObjectMetadata)
public CannedAccessControlList getCannedAcl()
setCannedAcl(CannedAccessControlList)
,
withCannedAcl(CannedAccessControlList)
public void setCannedAcl(CannedAccessControlList cannedAcl)
cannedAcl
- The optional pre-configured access control policy to use
for the new object.getCannedAcl()
,
withCannedAcl(CannedAccessControlList)
public <T extends AbstractPutObjectRequest> T withCannedAcl(CannedAccessControlList cannedAcl)
AbstractPutObjectRequest
, enabling
additional method calls to be chained together.cannedAcl
- The optional pre-configured access control policy to use
for the new object.AbstractPutObjectRequest
, enabling additional method
calls to be chained together.getCannedAcl()
,
setCannedAcl(CannedAccessControlList)
public AccessControlList getAccessControlList()
public void setAccessControlList(AccessControlList accessControlList)
accessControlList
- The access control list for the new object.public <T extends AbstractPutObjectRequest> T withAccessControlList(AccessControlList accessControlList)
AbstractPutObjectRequest
,
enabling additional method calls to be chained together.accessControlList
- The access control list for the new object.public java.io.InputStream getInputStream()
getInputStream
in interface S3DataSource
setInputStream(InputStream)
,
withInputStream(InputStream)
,
setFile(File)
,
withFile(File)
public void setInputStream(java.io.InputStream inputStream)
setInputStream
in interface S3DataSource
inputStream
- The input stream containing the data to be uploaded to
Amazon S3. Either specify a file or an input stream containing
the data to be uploaded to Amazon S3, not both.getInputStream()
,
withInputStream(InputStream)
,
getFile()
,
withFile(File)
public <T extends AbstractPutObjectRequest> T withInputStream(java.io.InputStream inputStream)
AbstractPutObjectRequest
, enabling additional method
calls to be chained together.
Either specify a file or an input stream containing the data to be uploaded to Amazon S3; both cannot be specified.
inputStream
- The InputStream containing the data to be uploaded to
Amazon S3.getInputStream()
,
setInputStream(InputStream)
,
getFile()
,
setFile(File)
public void setRedirectLocation(java.lang.String redirectLocation)
redirectLocation
- The redirect location for the new object.public java.lang.String getRedirectLocation()
public <T extends AbstractPutObjectRequest> T withRedirectLocation(java.lang.String redirectLocation)
AbstractPutObjectRequest
, enabling additional method calls to be
chained together.redirectLocation
- The redirect location for the new object.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 uploaded object.public <T extends AbstractPutObjectRequest> T withSSECustomerKey(SSECustomerKey sseKey)
sseKey
- The optional customer-provided server-side encryption key
to use to encrypt the uploaded object.public ObjectTagging getTagging()
public void setTagging(ObjectTagging tagging)
tagging
- Object tagging to attachpublic <T extends AbstractPutObjectRequest> T withTagging(ObjectTagging tagSet)
tagSet
- Object tagging to be attached to this request@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 <T extends AbstractPutObjectRequest> T withProgressListener(ProgressListener progressListener)
AmazonWebServiceRequest.withGeneralProgressListener(ProgressListener)
instead.progressListener
- The legacy progress listener that is used
exclusively for Amazon S3 client.public SSEAwsKeyManagementParams getSSEAwsKeyManagementParams()
getSSEAwsKeyManagementParams
in interface SSEAwsKeyManagementParamsProvider
public void setSSEAwsKeyManagementParams(SSEAwsKeyManagementParams params)
public <T extends AbstractPutObjectRequest> T withSSEAwsKeyManagementParams(SSEAwsKeyManagementParams sseAwsKeyManagementParams)
public AbstractPutObjectRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.