use of software.amazon.awssdk.services.s3.model.DeleteBucketCorsRequest in project aws-doc-sdk-examples by awsdocs.
the class S3Cors method deleteBucketCorsInformation.
// snippet-start:[s3.java2.cors.main]
public static void deleteBucketCorsInformation(S3Client s3, String bucketName, String accountId) {
try {
DeleteBucketCorsRequest bucketCorsRequest = DeleteBucketCorsRequest.builder().bucket(bucketName).expectedBucketOwner(accountId).build();
s3.deleteBucketCors(bucketCorsRequest);
} catch (S3Exception e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations