/** * Determines whether the client should use the {@link Headers#ETAG} header returned by S3 to * validate the integrity of the message client side based on the server response. We skip the * client side check if any of the following conditions are true: * <ol> * <li>The system property {@value #DISABLE_GET_OBJECT_MD5_VALIDATION_PROPERTY} is set</li> * <li>The request involves SSE-C or SSE-KMS</li> * <li>The Etag header is missing</li> * <li>The Etag indicates that the object was created by a MultiPart Upload</li> * </ol> * * @return True if client side validation should be skipped, false otherwise. */ public boolean skipClientSideValidationPerGetResponse(ObjectMetadata metadata) { if (isGetObjectMd5ValidationDisabledByProperty()) { return true; } return skipClientSideValidationPerResponse(metadata); }
/** * Based on the given {@link GetObjectRequest}, returns whether the specified request should * skip MD5 check on the requested object content. Specifically, MD5 check should be skipped if * one of the following conditions are true: * <ol> * <li>The system property {@value #DISABLE_GET_OBJECT_MD5_VALIDATION_PROPERTY} is set.</li> * <li>The request is a range-get operation</li> * <li>The request is a GET object operation that involves SSE-C</li> * </ol> * Otherwise, MD5 check should not be skipped. */ public boolean skipClientSideValidationPerRequest(GetObjectRequest request) { if (isGetObjectMd5ValidationDisabledByProperty()) { return true; } // Skip MD5 check for range get if (request.getRange() != null) { return true; } if (request.getSSECustomerKey() != null) { return true; } return false; }
/** * Determines whether the client should use the {@link Headers#ETAG} header returned by S3 to * validate the integrity of the message client side based on the server response. We skip the * client side check if any of the following conditions are true: * <ol> * <li>The system property {@value #DISABLE_GET_OBJECT_MD5_VALIDATION_PROPERTY} is set</li> * <li>The request involves SSE-C or SSE-KMS</li> * <li>The Etag header is missing</li> * <li>The Etag indicates that the object was created by a MultiPart Upload</li> * </ol> * * @return True if client side validation should be skipped, false otherwise. */ public boolean skipClientSideValidationPerGetResponse(ObjectMetadata metadata) { if (isGetObjectMd5ValidationDisabledByProperty()) { return true; } return skipClientSideValidationPerResponse(metadata); }
/** * Based on the given {@link GetObjectRequest}, returns whether the specified request should * skip MD5 check on the requested object content. Specifically, MD5 check should be skipped if * one of the following conditions are true: * <ol> * <li>The system property {@value #DISABLE_GET_OBJECT_MD5_VALIDATION_PROPERTY} is set.</li> * <li>The request is a range-get operation</li> * <li>The request is a GET object operation that involves SSE-C</li> * </ol> * Otherwise, MD5 check should not be skipped. */ public boolean skipClientSideValidationPerRequest(GetObjectRequest request) { if (isGetObjectMd5ValidationDisabledByProperty()) { return true; } // Skip MD5 check for range get if (request.getRange() != null) { return true; } if (request.getSSECustomerKey() != null) { return true; } return false; }