public abstract class AbstractPutObjectRequest extends AmazonWebServiceRequest implements Cloneable, SSECustomerKeyProvider, SSEAwsKeyManagementParamsProvider, S3DataSource, Serializable
S3DataSource.Utils
NOOP
Constructor and Description |
---|
AbstractPutObjectRequest(String bucketName,
String key,
File file)
Constructs a new
AbstractPutObjectRequest object to upload a file to the
specified bucket and key. |
AbstractPutObjectRequest(String bucketName,
String key,
String redirectLocation)
Constructs a new
AbstractPutObjectRequest object with redirect location. |
Modifier and Type | Method and Description |
---|---|
AbstractPutObjectRequest |
clone()
Creates a shallow clone of this object for all fields except the handler context.
|
AccessControlList |
getAccessControlList()
Returns the optional access control list for the new object.
|
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.
|
File |
getFile()
Gets the path and name of the file
containing the data to be uploaded to Amazon S3.
|
InputStream |
getInputStream()
Gets the input stream containing the data to be uploaded to Amazon S3.
|
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. |
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.
|
String |
getStorageClass()
Gets the optional Amazon S3 storage class to use when storing the new
object.
|
ObjectTagging |
getTagging() |
void |
setAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new object.
|
void |
setBucketName(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(File file)
Sets the path and name of the file
containing the data to be uploaded to Amazon S3.
|
void |
setInputStream(InputStream inputStream)
Sets the input stream containing the data to be uploaded to Amazon S3.
|
void |
setKey(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(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(String storageClass)
Sets the optional Amazon S3 storage class to use when storing the new
object.
|
void |
setTagging(ObjectTagging tagging) |
<T extends AbstractPutObjectRequest> |
withAccessControlList(AccessControlList accessControlList)
Sets the optional access control list for the new object.
|
<T extends AbstractPutObjectRequest> |
withBucketName(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(File file)
Sets the file containing the data to be uploaded to Amazon S3.
|
<T extends AbstractPutObjectRequest> |
withInputStream(InputStream inputStream)
Sets the input stream containing the data to be uploaded to Amazon S3.
|
<T extends AbstractPutObjectRequest> |
withKey(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(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(String storageClass)
Sets the optional Amazon S3 storage class to use when storing the new
object.
|
<T extends PutObjectRequest> |
withTagging(ObjectTagging tagSet) |
addHandlerContext, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getHandlerContext, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestCredentialsProvider, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
public AbstractPutObjectRequest(String bucketName, String key, 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(String bucketName, String key, 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 String getBucketName()
Permission.Write
permission granted.setBucketName(String)
,
withBucketName(String)
public void setBucketName(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(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 String getKey()
setKey(String)
,
withKey(String)
public void setKey(String key)
key
- The key under which to store the new object.getKey()
,
withKey(String)
public <T extends AbstractPutObjectRequest> T withKey(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 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(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(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 File getFile()
getFile
in interface S3DataSource
setFile(File)
,
withFile(File)
,
setInputStream(InputStream)
,
withInputStream(InputStream)
public void setFile(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(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 InputStream getInputStream()
getInputStream
in interface S3DataSource
setInputStream(InputStream)
,
withInputStream(InputStream)
,
setFile(File)
,
withFile(File)
public void setInputStream(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(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(String redirectLocation)
redirectLocation
- The redirect location for the new object.public String getRedirectLocation()
public <T extends AbstractPutObjectRequest> T withRedirectLocation(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)
public <T extends PutObjectRequest> T withTagging(ObjectTagging tagSet)
@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 © 2013 Amazon Web Services, Inc. All Rights Reserved.