@Test public void testCalculateChecksumMd5() throws IOException { Path testfile = getTestResource( "examples/redback-authz-open.jar" ); ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); String expectedChecksum = "f42047fe2e177ac04d0df7aa44d408be"; String actualChecksum = checksummedFile.calculateChecksum( ChecksumAlgorithm.MD5 ); Assert.assertEquals( expectedChecksum, actualChecksum ); }
public String calculateChecksum( ChecksumAlgorithm checksumAlgorithm ) throws IOException { Checksum checksum = new Checksum( checksumAlgorithm ); ChecksumUtil.update(checksum, referenceFile ); return checksum.getChecksum( ); }
ChecksummedFile { public String calculateChecksum( ChecksumAlgorithm checksumAlgorithm ) throws IOException { Checksum checksum = new Checksum( checksumAlgorithm ); ChecksumUtil.update(checksum, referenceFile ); return checksum.getChecksum( ); } }
ChecksummedFile { public String calculateChecksum( ChecksumAlgorithm checksumAlgorithm ) throws IOException { Checksum checksum = new Checksum( checksumAlgorithm ); ChecksumUtil.update(checksum, referenceFile ); return checksum.getChecksum( ); } ChecksummedFile( final Path referenceFile ); }
ChecksummedFile { public String calculateChecksum( ChecksumAlgorithm checksumAlgorithm ) throws IOException { Checksum checksum = new Checksum( checksumAlgorithm ); ChecksumUtil.update(checksum, referenceFile ); return checksum.getChecksum( ); } ChecksummedFile( final Path referenceFile ); static ChecksumReference getFromChecksumFile( Path checksumFile ); String calculateChecksum( ChecksumAlgorithm checksumAlgorithm ); Path writeFile(ChecksumAlgorithm checksumAlgorithm ); Path getChecksumFile( ChecksumAlgorithm checksumAlgorithm ); boolean isValidChecksum( ChecksumAlgorithm algorithm); boolean isValidChecksum( ChecksumAlgorithm algorithm, boolean throwExceptions ); boolean isValidChecksums( List<ChecksumAlgorithm> algorithms); boolean isValidChecksums( List<ChecksumAlgorithm> algorithms, boolean throwExceptions); Path getReferenceFile( ); UpdateStatusList fixChecksum(ChecksumAlgorithm algorithm); UpdateStatusList fixChecksums( List<ChecksumAlgorithm> algorithms ); String parseChecksum( Path checksumFile, ChecksumAlgorithm checksumAlgorithm, String fileName, Charset encoding ); ChecksumFileContent parseChecksumFile( Path checksumFile, ChecksumAlgorithm checksumAlgorithm, Charset encoding ); }
ChecksummedFile { public String calculateChecksum( ChecksumAlgorithm checksumAlgorithm ) throws IOException { Checksum checksum = new Checksum( checksumAlgorithm ); ChecksumUtil.update(checksum, referenceFile ); return checksum.getChecksum( ); } ChecksummedFile( final Path referenceFile ); static ChecksumReference getFromChecksumFile( Path checksumFile ); String calculateChecksum( ChecksumAlgorithm checksumAlgorithm ); Path writeFile(ChecksumAlgorithm checksumAlgorithm ); Path getChecksumFile( ChecksumAlgorithm checksumAlgorithm ); boolean isValidChecksum( ChecksumAlgorithm algorithm); boolean isValidChecksum( ChecksumAlgorithm algorithm, boolean throwExceptions ); boolean isValidChecksums( List<ChecksumAlgorithm> algorithms); boolean isValidChecksums( List<ChecksumAlgorithm> algorithms, boolean throwExceptions); Path getReferenceFile( ); UpdateStatusList fixChecksum(ChecksumAlgorithm algorithm); UpdateStatusList fixChecksums( List<ChecksumAlgorithm> algorithms ); String parseChecksum( Path checksumFile, ChecksumAlgorithm checksumAlgorithm, String fileName, Charset encoding ); ChecksumFileContent parseChecksumFile( Path checksumFile, ChecksumAlgorithm checksumAlgorithm, Charset encoding );  }