public class DeleteObjectsRequest extends AmazonWebServiceRequest implements Serializable, ExpectedBucketOwnerRequest
Modifier and Type | Class and Description |
---|---|
static class |
DeleteObjectsRequest.KeyVersion
A key to delete, with an optional version attribute.
|
NOOP
Constructor and Description |
---|
DeleteObjectsRequest(String bucketName)
Constructs a new
DeleteObjectsRequest , specifying the objects'
bucket name. |
Modifier and Type | Method and Description |
---|---|
String |
getBucketName()
The bucket name containing the objects to delete.
|
boolean |
getBypassGovernanceRetention()
Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place.
|
String |
getExpectedBucketOwner()
Returns he account id of the expected bucket owner.
|
List<DeleteObjectsRequest.KeyVersion> |
getKeys()
Returns the list of keys to delete from this bucket.
|
MultiFactorAuthentication |
getMfa()
Gets the optional Multi-Factor Authentication information included
with this request.
|
boolean |
getQuiet()
Returns the quiet element for this request.
|
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 containing the objects to delete.
|
void |
setBypassGovernanceRetention(boolean bypassGovernanceRetention)
Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place.
|
void |
setExpectedBucketOwner(String expectedBucketOwner)
Set the account id of the expected bucket owner.
|
void |
setKeys(List<DeleteObjectsRequest.KeyVersion> keys)
Sets the list of keys to delete from this bucket, clearing any existing
list of keys.
|
void |
setMfa(MultiFactorAuthentication mfa)
Sets the optional Multi-Factor Authentication information to include with
this request.
|
void |
setQuiet(boolean quiet)
Sets the quiet element for this request.
|
void |
setRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
DeleteObjectsRequest |
withBucketName(String bucketName)
The bucket name containing the objects to delete.
|
DeleteObjectsRequest |
withBypassGovernanceRetention(boolean bypassGovernanceRetention)
Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place.
|
DeleteObjectsRequest |
withExpectedBucketOwner(String expectedBucketOwner)
Set the account id of the expected bucket owner.
|
DeleteObjectsRequest |
withKeys(List<DeleteObjectsRequest.KeyVersion> keys)
Sets the list of keys to delete from this bucket, clearing any existing
list of keys.
|
DeleteObjectsRequest |
withKeys(String... keys)
Convenience method to specify a set of keys without versions.
|
DeleteObjectsRequest |
withMfa(MultiFactorAuthentication mfa)
Sets the optional Multi-Factor Authentication information to include with
this request
Returns this, enabling additional method
calls to be chained together.
|
DeleteObjectsRequest |
withQuiet(boolean quiet)
Sets the quiet element for this request.
|
DeleteObjectsRequest |
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 DeleteObjectsRequest(String bucketName)
DeleteObjectsRequest
, specifying the objects'
bucket name.bucketName
- The name of the Amazon S3 bucket containing the object(s) to
delete.public String getExpectedBucketOwner()
ExpectedBucketOwnerRequest
403 (Access Denied)
error.getExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public DeleteObjectsRequest withExpectedBucketOwner(String expectedBucketOwner)
ExpectedBucketOwnerRequest
403 (Access Denied)
error.withExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public void setExpectedBucketOwner(String expectedBucketOwner)
ExpectedBucketOwnerRequest
403 (Access Denied)
error.setExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public String getBucketName()
The bucket name containing the objects to delete.
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.
setBucketName(String)
public void setBucketName(String bucketName)
The bucket name containing the objects to delete.
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 containing the objects to delete.
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.
getBucketName()
public DeleteObjectsRequest withBucketName(String bucketName)
The bucket name containing the objects to delete.
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 containing the objects to delete.
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.
DeleteObjectsRequest
object, enabling
additional method calls to be chained together.public MultiFactorAuthentication getMfa()
Gets the optional Multi-Factor Authentication information included with this request.
Multi-Factor Authentication is required when deleting an object version from a bucket which has MFADelete enabled in its bucket versioning configuration.
See BucketVersioningConfiguration.setMfaDeleteEnabled(Boolean)
for more information on MFADelete.
public void setMfa(MultiFactorAuthentication mfa)
Sets the optional Multi-Factor Authentication information to include with this request.
Multi-Factor Authentication is required when deleting an object version from a bucket which has MFADelete enabled in its bucket versioning configuration.
See BucketVersioningConfiguration.setMfaDeleteEnabled(Boolean)
for more information on MFADelete.
mfa
- The optional Multi-Factor Authentication information to
include with this request.public DeleteObjectsRequest withMfa(MultiFactorAuthentication mfa)
Sets the optional Multi-Factor Authentication information to include with this request Returns this, enabling additional method calls to be chained together.
Multi-Factor Authentication is required when deleting an object version from a bucket which has MFADelete enabled in its bucket versioning configuration
See BucketVersioningConfiguration.setMfaDeleteEnabled(Boolean)
for more information on MFADelete.
mfa
- The optional Multi-Factor Authentication information to
include with this request.public void setQuiet(boolean quiet)
public boolean getQuiet()
public DeleteObjectsRequest withQuiet(boolean quiet)
public void setKeys(List<DeleteObjectsRequest.KeyVersion> keys)
keys
- The list of keys to delete from this bucketpublic DeleteObjectsRequest withKeys(List<DeleteObjectsRequest.KeyVersion> keys)
keys
- The list of keys to delete from this bucketpublic List<DeleteObjectsRequest.KeyVersion> getKeys()
public DeleteObjectsRequest withKeys(String... keys)
withKeys(List)
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 DeleteObjectsRequest 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.public boolean getBypassGovernanceRetention()
Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place. To use this
header, you must have the s3:PutBucketPublicAccessBlock
permission.
public DeleteObjectsRequest withBypassGovernanceRetention(boolean bypassGovernanceRetention)
Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place. To use this
header, you must have the s3:PutBucketPublicAccessBlock
permission.
public void setBypassGovernanceRetention(boolean bypassGovernanceRetention)
Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place. To use this
header, you must have the s3:PutBucketPublicAccessBlock
permission.
Copyright © 2024. All rights reserved.