當前位置: 首頁>>代碼示例>>Java>>正文


Java DigesterException類代碼示例

本文整理匯總了Java中org.codehaus.plexus.digest.DigesterException的典型用法代碼示例。如果您正苦於以下問題:Java DigesterException類的具體用法?Java DigesterException怎麽用?Java DigesterException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DigesterException類屬於org.codehaus.plexus.digest包,在下文中一共展示了DigesterException類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeMergedMetadataToFile

import org.codehaus.plexus.digest.DigesterException; //導入依賴的package包/類
private File writeMergedMetadataToFile( ArchivaRepositoryMetadata mergedMetadata, String outputFilename )
    throws RepositoryMetadataException, DigesterException, IOException
{
    File outputFile = new File( outputFilename );
    if ( outputFile.exists() )
    {
        FileUtils.deleteQuietly( outputFile );
    }

    outputFile.getParentFile().mkdirs();
    RepositoryMetadataWriter.write( mergedMetadata, outputFile );

    createChecksumFile( outputFilename, digestSha1 );
    createChecksumFile( outputFilename, digestMd5 );

    return outputFile;
}
 
開發者ID:ruikom,項目名稱:apache-archiva,代碼行數:18,代碼來源:ArchivaDavResourceFactory.java

示例2: verifyChecksum

import org.codehaus.plexus.digest.DigesterException; //導入依賴的package包/類
private boolean verifyChecksum( File file, String fileName, Digester digester, Artifact artifact, String key )
    throws IOException
{
    boolean result = true;

    File checksumFile = new File( file.getParentFile(), fileName );
    if ( checksumFile.exists() )
    {
        String checksum = FileUtils.readFileToString( checksumFile, Charset.defaultCharset() );
        try
        {
            digester.verify( file, checksum );
        }
        catch ( DigesterException e )
        {
            addWarning( artifact, Messages.getString( key ) );
            result = false;
        }
    }
    return result;
}
 
開發者ID:ruikom,項目名稱:apache-archiva,代碼行數:22,代碼來源:LegacyToDefaultConverter.java

示例3: writeMergedMetadataToFile

import org.codehaus.plexus.digest.DigesterException; //導入依賴的package包/類
private Path writeMergedMetadataToFile( ArchivaRepositoryMetadata mergedMetadata, String outputFilename )
    throws RepositoryMetadataException, DigesterException, IOException
{
    Path outputFile = Paths.get( outputFilename );
    if ( Files.exists(outputFile) )
    {
        org.apache.archiva.common.utils.FileUtils.deleteQuietly( outputFile );
    }

    Files.createDirectories(outputFile.getParent());
    RepositoryMetadataWriter.write( mergedMetadata, outputFile );

    createChecksumFile( outputFilename, digestSha1 );
    createChecksumFile( outputFilename, digestMd5 );

    return outputFile;
}
 
開發者ID:apache,項目名稱:archiva,代碼行數:18,代碼來源:ArchivaDavResourceFactory.java

示例4: verifyChecksum

import org.codehaus.plexus.digest.DigesterException; //導入依賴的package包/類
private boolean verifyChecksum( Path file, String fileName, Digester digester, Artifact artifact, String key )
    throws IOException
{
    boolean result = true;

    Path checksumFile = file.resolveSibling( fileName );
    if ( Files.exists(checksumFile) )
    {
        String checksum = org.apache.archiva.common.utils.FileUtils.readFileToString( checksumFile, Charset.defaultCharset() );
        try
        {
            digester.verify( file.toFile(), checksum );
        }
        catch ( DigesterException e )
        {
            addWarning( artifact, Messages.getString( key ) );
            result = false;
        }
    }
    return result;
}
 
開發者ID:apache,項目名稱:archiva,代碼行數:22,代碼來源:LegacyToDefaultConverter.java

示例5: createChecksumFile

import org.codehaus.plexus.digest.DigesterException; //導入依賴的package包/類
private void createChecksumFile( String path, Digester digester )
    throws DigesterException, IOException
{
    File checksumFile = new File( path + digester.getFilenameExtension() );
    if ( !checksumFile.exists() )
    {
        FileUtils.deleteQuietly( checksumFile );
        checksum.createChecksum( new File( path ), digester );
    }
    else if ( !checksumFile.isFile() )
    {
        log.error( "Checksum file is not a file." );
    }
}
 
開發者ID:ruikom,項目名稱:apache-archiva,代碼行數:15,代碼來源:ArchivaDavResourceFactory.java

示例6: createChecksums

import org.codehaus.plexus.digest.DigesterException; //導入依賴的package包/類
/**
 * 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( File file, boolean force )
    throws IOException
{
    for ( Digester digester : getDigesters() )
    {
        File checksumFile = new File( file.getAbsolutePath() + "." + getDigesterFileExtension( digester ) );
        if ( checksumFile.exists() )
        {
            if ( !force )
            {
                continue;
            }
            createBackup( checksumFile );
        }
        else
        {
            createdFiles.add( checksumFile );
        }

        try
        {
            writeStringToFile( checksumFile, digester.calc( file ) );
        }
        catch ( DigesterException e )
        {
            throw (IOException) e.getCause();
        }
    }
}
 
開發者ID:ruikom,項目名稱:apache-archiva,代碼行數:37,代碼來源:AbstractTransactionEvent.java

示例7: createChecksumFile

import org.codehaus.plexus.digest.DigesterException; //導入依賴的package包/類
private void createChecksumFile( String path, Digester digester )
    throws DigesterException, IOException
{
    Path checksumFile = Paths.get( path + digester.getFilenameExtension() );
    if ( !Files.exists(checksumFile) )
    {
        org.apache.archiva.common.utils.FileUtils.deleteQuietly( checksumFile );
        checksum.createChecksum( Paths.get( path ).toFile(), digester );
    }
    else if ( !Files.isRegularFile( checksumFile) )
    {
        log.error( "Checksum file is not a file." );
    }
}
 
開發者ID:apache,項目名稱:archiva,代碼行數:15,代碼來源:ArchivaDavResourceFactory.java

示例8: createChecksums

import org.codehaus.plexus.digest.DigesterException; //導入依賴的package包/類
/**
 * 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 ( Digester digester : getDigesters() )
    {
        Path checksumFile = Paths.get(file.toAbsolutePath() + "." + getDigesterFileExtension( digester ) );
        if ( Files.exists(checksumFile) )
        {
            if ( !force )
            {
                continue;
            }
            createBackup( checksumFile );
        }
        else
        {
            createdFiles.add( checksumFile );
        }

        try
        {
            writeStringToFile( checksumFile, digester.calc( file.toFile() ) );
        }
        catch ( DigesterException e )
        {
            throw (IOException) e.getCause();
        }
    }
}
 
開發者ID:apache,項目名稱:archiva,代碼行數:37,代碼來源:AbstractTransactionEvent.java


注:本文中的org.codehaus.plexus.digest.DigesterException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。