archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java
/**
     * Writes a checksum file for the referenceFile.
     *
     * @param checksumAlgorithm the hash to use.
     * @return the checksum File that was created.
     * @throws IOException if there was a problem either reading the referenceFile, or writing the checksum file.
     */
Writes a checksum file for the referenceFile.
@param checksumAlgorithm the hash to use.
@return the checksum File that was created.
@throws IOException if there was a problem either reading the referenceFile, or writing the checksum file.
Writes a checksum file for the referenceFile . @param checksumAlgorithm the hash to use . @return the checksum File that was created . @throws IOException if there was a problem either reading the referenceFile or writing the checksum file .
public Path writeFile(ChecksumAlgorithm checksumAlgorithm )
        throws IOException
    {
        Path checksumFile = referenceFile.resolveSibling( referenceFile.getFileName( ) + "." + checksumAlgorithm.getDefaultExtension() );
        Files.deleteIfExists( checksumFile );
        String checksum = calculateChecksum( checksumAlgorithm );
        Files.write( checksumFile, 
            ( checksum + "  " + referenceFile.getFileName( ).toString( ) ).getBytes( ), 
            StandardOpenOption.CREATE_NEW );
        return checksumFile;
    }
public Path writeFile ( ChecksumAlgorithm checksumAlgorithm ) throws IOException { Path checksumFile = referenceFile . resolveSibling ( referenceFile . getFileName ( ) + "." + checksumAlgorithm . getDefaultExtension ( ) ) ; Files . deleteIfExists ( checksumFile ) ; String checksum = calculateChecksum ( checksumAlgorithm ) ; Files . write ( checksumFile , ( checksum + "  " + referenceFile . getFileName ( ) . toString ( ) ) . getBytes ( ) , StandardOpenOption . CREATE_NEW ) ; return checksumFile ; }
Writes a checksum file for the referenceFile.
Writes a checksum file for the referenceFile .
// //