Reputation: 63
Using AmazonS3 SDK how can we delete an S3 Object using the key(i.e. file name) and eTag for the object ?
We can get file by eTag leveraging below code
GetObjectRequest request = new GetObjectRequest(bucket, key);
request.setMatchingETagConstraints(Collections.singletonList(eTag));
do we have similar API to delete an Object from S3 ?
Upvotes: 1
Views: 1465
Reputation: 2125
No, there is no setMatchingETagConstraints
method for deleteobjectrequest. You will need to get the key first as you describe.
Upvotes: 1