+ " does not exist to check." );
}
if ( FAIL.equals( policySetting ) )
{
ChecksummedFile checksum = new ChecksummedFile( localFile );
if ( checksum.isValidChecksums( algorithms ) )
{
return;
}
for ( ChecksumAlgorithm algorithm : algorithms )
{
File file = new File( localFile.getAbsolutePath() + "." + algorithm.getExt() );
if ( file.exists() )
{
file.delete();
}
}
localFile.delete();
throw new PolicyViolationException( "Checksums do not match, policy set to FAIL, "
+ "deleting checksum files and local file " + localFile.getAbsolutePath() + "." );
}
if ( FIX.equals( policySetting ) )
{
ChecksummedFile checksum = new ChecksummedFile( localFile );
if( checksum.fixChecksums( algorithms ) )
{
log.debug( "Checksum policy set to FIX, checksum files have been updated." );
return;
}
else