private static String calculateMessageBodyMd5 ( String messageBody ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Message body: " + messageBody ) ; } byte [ ] expectedMd5 ; try { expectedMd5 = Md5Utils . computeMD5Hash ( messageBody . getBytes ( UTF8 ) ) ; } catch ( Exception e ) { throw new AmazonClientException ( "Unable to calculate the MD5 hash of the message body. " + e . getMessage ( ) , e ) ; } String expectedMd5Hex = BinaryUtils . toHex ( expectedMd5 ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Expected MD5 of message body: " + expectedMd5Hex ) ; } return expectedMd5Hex ; }
Returns the hex - encoded MD5 hash String of the given message body .