in src/main/java/software/amazon/encryption/s3/S3EncryptionClient.java [409:430]
public DeleteObjectsResponse deleteObjects(DeleteObjectsRequest deleteObjectsRequest) throws AwsServiceException,
SdkClientException {
DeleteObjectsRequest actualRequest = deleteObjectsRequest.toBuilder()
.overrideConfiguration(API_NAME_INTERCEPTOR)
.build();
try {
// Delete the objects
DeleteObjectsResponse deleteObjectsResponse = _wrappedAsyncClient.deleteObjects(actualRequest).join();
// If Instruction files exists, delete the instruction files as well.
List<ObjectIdentifier> deleteObjects = instructionFileKeysToDelete(deleteObjectsRequest);
_wrappedAsyncClient.deleteObjects(DeleteObjectsRequest.builder()
.overrideConfiguration(API_NAME_INTERCEPTOR)
.bucket(deleteObjectsRequest.bucket())
.delete(builder -> builder.objects(deleteObjects))
.build()).join();
return deleteObjectsResponse;
} catch (CompletionException e) {
throw new S3EncryptionClientException(e.getCause().getMessage(), e.getCause());
} catch (Exception e) {
throw new S3EncryptionClientException("Unable to delete objects.", e);
}
}