File parent = root.getParentFile();
File checksumFile = getChecksumFile(moduleName, modulePart);
// Generate a checksum for the module part and write out. Overwrite any
// existing checksum file it is exists.
ChecksumList checksums = new ChecksumList();
try {
// Generate the checksums based upon the files present
String sha = ChecksumUtils.SHA1_CHECKSUM_ALGORITHM;
checksums = ChecksumUtils.generate(parent, root, sha, null, null);
} catch (NoSuchAlgorithmException excp) {
// Log an error, although this exception should never happen
logger.log(Level.WARNING, "Unable to generate checksums for" +
" module " + moduleName + " and part " + modulePart, excp);
return;
}
// Generate all of the necessary directories for the checksum file
File checksumParent = checksumFile.getParentFile();
checksumParent.mkdirs();
// Write out the newly generated checksums to the file. If we cannot
// then log an error. Make sure the writer is closed under any event
// however.
FileWriter writer = null;
try {
// Write the checksums out to a checksums file
writer = new FileWriter(checksumFile);
checksums.encode(writer);
} catch (java.lang.Exception excp) {
logger.log(Level.WARNING, "Unable to write checksums.xml to " +
checksumFile.getAbsolutePath() + " for module name " +
moduleName + " and part " + modulePart, excp);
} finally {