public class DeleteObjectRequest extends AmazonWebServiceRequest implements 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.
NOOP
Constructor and Description |
---|
DeleteObjectRequest(String bucketName,
String key)
Constructs a new
DeleteObjectRequest ,
specifying the object's bucket name and key. |
Modifier and Type | Method and Description |
---|---|
String |
getBucketName()
The bucket name of the bucket containing the object.
|
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(String bucketName)
The bucket name of the bucket containing the object.
|
void |
setKey(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(String bucketName)
The bucket name of the bucket containing the object.
|
DeleteObjectRequest |
withKey(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.
|
addHandlerContext, clone, copyBaseTo, 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 DeleteObjectRequest(String bucketName, 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 String getBucketName()
The bucket name of the bucket containing the object.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The
S3 on Outposts hostname takes the form
AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
When you use this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts in the
Amazon S3 User Guide.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts
hostname. The S3 on Outposts hostname takes the form
AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
When you use this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts
in the Amazon S3 User Guide.
DeleteObjectRequest.setBucketName(String)
public void setBucketName(String bucketName)
The bucket name of the bucket containing the object.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The
S3 on Outposts hostname takes the form
AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
When you use this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts in the
Amazon S3 User Guide.
bucketName
- The bucket name of the bucket containing the object.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts
hostname. The S3 on Outposts hostname takes the form
AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
When you use this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts
in the Amazon S3 User Guide.
DeleteObjectRequest.getBucketName()
public DeleteObjectRequest withBucketName(String bucketName)
The bucket name of the bucket containing the object.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The
S3 on Outposts hostname takes the form
AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
When you use this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts in the
Amazon S3 User Guide.
bucketName
- The bucket name of the bucket containing the object.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When you use this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts
hostname. The S3 on Outposts hostname takes the form
AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com
.
When you use this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts
access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see What is S3 on Outposts
in the Amazon S3 User Guide.
DeleteObjectRequest
object, enabling additional method
calls to be chained together.public String getKey()
DeleteObjectRequest.setKey(String)
public void setKey(String key)
key
- The key of the object to delete.DeleteObjectRequest.getKey()
public DeleteObjectRequest withKey(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 © 2024. All rights reserved.