private boolean areHashFilesEqual ( File hashFile1 , File hashFile2 , String remoteLocation ) throws ResourceDownloadError { try { String resource1Hash = readFileToString ( hashFile1 , UTF_8 ) ; String resource2Hash = readFileToString ( hashFile2 , UTF_8 ) ; return resource1Hash . trim ( ) . equalsIgnoreCase ( resource2Hash . trim ( ) ) ; } catch ( IOException e ) { throw new ResourceDownloadError ( remoteLocation , e . getMessage ( ) ) ; } }
Compares the hashes contained in the resource files . The hashes in the files are compared case - insensitively in order to support hexadecimal variations on a - f and A - F .