use of org.apache.archiva.checksum.ChecksumAlgorithm in project archiva by apache.
the class AbstractTransactionEvent method createChecksums.
/**
* Create checksums of file using all digesters defined at construction time.
*
* @param file
* @param force whether existing checksums should be overwritten or not
* @throws IOException
*/
protected void createChecksums(Path file, boolean force) throws IOException {
for (ChecksumAlgorithm checksumAlgorithm : getChecksumAlgorithms()) {
Path checksumFile = Paths.get(file.toAbsolutePath() + "." + getChecksumFileExtension(checksumAlgorithm));
if (Files.exists(checksumFile)) {
if (!force) {
continue;
}
createBackup(checksumFile);
} else {
createdFiles.add(checksumFile);
}
}
ChecksummedFile csFile = new ChecksummedFile(file);
csFile.fixChecksums(getChecksumAlgorithms());
}
Aggregations