private boolean skipClientSideValidationPerResponse(ObjectMetadata metadata) { if (metadata == null) { return true; } // If Etag is not provided or was computed from a multipart upload then skip the check, the // etag won't be the MD5 of the original content if (metadata.getETag() == null || isMultipartUploadETag(metadata.getETag())) { return true; } return metadataInvolvesSse(metadata); }
/** * Determines whether the client should use the {@link Headers#ETAG} header returned by S3 to * validate the integrity of the message client side. We skip the client side check if any of * the following conditions are true: * <ol> * <li>The system property {@value #DISABLE_PUT_OBJECT_MD5_VALIDATION_PROPERTY} is set</li> * <li>The request involves SSE-C or SSE-KMS</li> * </ol> * * @return True if client side validation should be skipped, false otherwise. */ public boolean skipClientSideValidationPerRequest(PutObjectRequest request) { if (isPutObjectMd5ValidationDisabledByProperty()) { return true; } return putRequestInvolvesSse(request) || metadataInvolvesSse(request.getMetadata()); }
private boolean skipClientSideValidationPerResponse(ObjectMetadata metadata) { if (metadata == null) { return true; } // If Etag is not provided or was computed from a multipart upload then skip the check, the // etag won't be the MD5 of the original content if (metadata.getETag() == null || isMultipartUploadETag(metadata.getETag())) { return true; } return metadataInvolvesSse(metadata); }
/** * Determines whether the client should use the {@link Headers#ETAG} header returned by S3 to * validate the integrity of the message client side. We skip the client side check if any of * the following conditions are true: * <ol> * <li>The system property {@value #DISABLE_PUT_OBJECT_MD5_VALIDATION_PROPERTY} is set</li> * <li>The request involves SSE-C or SSE-KMS</li> * </ol> * * @return True if client side validation should be skipped, false otherwise. */ public boolean skipClientSideValidationPerRequest(PutObjectRequest request) { if (isPutObjectMd5ValidationDisabledByProperty()) { return true; } return putRequestInvolvesSse(request) || metadataInvolvesSse(request.getMetadata()); }