private void checkHashes ( Dependency dependency , String sha1 , String sha256 , String md5 ) throws FileNotFoundException { final String md5sum = dependency . getMd5sum ( ) ; if ( ! md5 . equals ( md5sum ) ) { throw new FileNotFoundException ( "Artifact found by API is not matching the md5 " + "of the artifact (repository hash is " + md5 + WHILE_ACTUAL_IS + md5sum + ") !" ) ; } final String sha1sum = dependency . getSha1sum ( ) ; if ( ! sha1 . equals ( sha1sum ) ) { throw new FileNotFoundException ( "Artifact found by API is not matching the SHA1 " + "of the artifact (repository hash is " + sha1 + WHILE_ACTUAL_IS + sha1sum + ") !" ) ; } final String sha256sum = dependency . getSha256sum ( ) ; if ( sha256 != null && ! sha256 . equals ( sha256sum ) ) { throw new FileNotFoundException ( "Artifact found by API is not matching the SHA-256 " + "of the artifact (repository hash is " + sha256 + WHILE_ACTUAL_IS + sha256sum + ") !" ) ; } }
Validates the hashes of the dependency .