public class DeleteObjectRequest extends AmazonWebServiceRequest implements java.io.Serializable
Provides options for deleting a specified object in a specified bucket. Once deleted, the object can only be restored if versioning was enabled when the object was deleted.
Note: If deleting an object that does not exist, Amazon S3 returns a success message, not an error message.
Constructor and Description |
---|
DeleteObjectRequest(java.lang.String bucketName,
java.lang.String key)
Constructs a new
DeleteObjectRequest ,
specifying the object's bucket name and key. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBucketName()
Gets the name of the Amazon S3 bucket containing the object to
delete.
|
java.lang.String |
getKey()
Gets the key of the object to delete.
|
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 Amazon S3 bucket containing the object to delete.
|
void |
setKey(java.lang.String key)
Sets the key of the object to delete.
|
void |
setRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
DeleteObjectRequest |
withBucketName(java.lang.String bucketName)
Sets the name of the Amazon S3 bucket containing the object to delete
and returns this object, enabling additional method calls to be chained
together.
|
DeleteObjectRequest |
withKey(java.lang.String key)
Sets the key of the object to delete and returns this object, enabling
additional method calls to be chained together.
|
DeleteObjectRequest |
withRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public DeleteObjectRequest(java.lang.String bucketName, java.lang.String key)
DeleteObjectRequest
,
specifying the object's bucket name and key.bucketName
- The name of the Amazon S3 bucket containing the object to
delete.key
- The key of the object to delete.public java.lang.String getBucketName()
setBucketName(String)
public void setBucketName(java.lang.String bucketName)
bucketName
- The name of the Amazon S3 bucket containing the object to
delete.getBucketName()
public DeleteObjectRequest withBucketName(java.lang.String bucketName)
bucketName
- The name of the Amazon S3 bucket containing the object to
delete.DeleteObjectRequest
object, enabling additional method
calls to be chained together.public java.lang.String getKey()
setKey(String)
public void setKey(java.lang.String key)
key
- The key of the object to delete.getKey()
public DeleteObjectRequest withKey(java.lang.String key)
key
- The key of the object to delete.DeleteObjectRequest
object, enabling additional method
calls to chained together.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 DeleteObjectRequest 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.