Search in sources :

Example 1 with DeleteObjectTaggingRequest

use of software.amazon.awssdk.services.s3.model.DeleteObjectTaggingRequest in project aws-doc-sdk-examples by awsdocs.

the class S3Service method deleteTagFromObject.

// Delete tags from the given object.
public void deleteTagFromObject(String bucketName, String key) {
    try {
        DeleteObjectTaggingRequest deleteObjectTaggingRequest = DeleteObjectTaggingRequest.builder().key(key).bucket(bucketName).build();
        S3Client s3 = getClient();
        s3.deleteObjectTagging(deleteObjectTaggingRequest);
    } catch (S3Exception e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
}
Also used : DeleteObjectTaggingRequest(software.amazon.awssdk.services.s3.model.DeleteObjectTaggingRequest) S3Exception(software.amazon.awssdk.services.s3.model.S3Exception) S3Client(software.amazon.awssdk.services.s3.S3Client)

Aggregations

S3Client (software.amazon.awssdk.services.s3.S3Client)1 DeleteObjectTaggingRequest (software.amazon.awssdk.services.s3.model.DeleteObjectTaggingRequest)1 S3Exception (software.amazon.awssdk.services.s3.model.S3Exception)1