}
public void processFile( String path )
throws ConsumerException
{
ArchivaArtifact artifact = getLiveArtifact( path );
if ( artifact == null )
{
return;
}
try
{
artifact.getModel().setRepositoryId( this.repository.getId() );
// Calculate the hashcodes.
File artifactFile = new File( this.repositoryDir, path );
try
{
artifact.getModel().setChecksumMD5( digestMd5.calc( artifactFile ) );
}
catch ( DigesterException e )
{
triggerConsumerWarning( CHECKSUM_CALCULATION, "Unable to calculate the MD5 checksum: " + e.getMessage() );
}
try
{
artifact.getModel().setChecksumSHA1( digestSha1.calc( artifactFile ) );
}
catch ( DigesterException e )
{
triggerConsumerWarning( CHECKSUM_CALCULATION, "Unable to calculate the SHA1 checksum: "
+ e.getMessage() );
}
artifact.getModel().setLastModified( new Date( artifactFile.lastModified() ) );
artifact.getModel().setSize( artifactFile.length() );
artifact.getModel().setOrigin( "FileSystem" );
dao.getArtifactDAO().saveArtifact( artifact );
}
catch ( ArchivaDatabaseException e )
{