{
log.debug( "File is a metadata file. Not indexing." );
return;
}
FileContentRecord record = new FileContentRecord();
try
{
File file = new File( repositoryDir, path );
record.setRepositoryId( this.repository.getId() );
record.setFilename( path );
record.setContents( FileUtils.readFileToString( file, null ) );
// Test for possible artifact reference syntax.
try
{
ArtifactReference ref = repository.toArtifactReference( path );
ArchivaArtifact artifact = new ArchivaArtifact( ref );
artifact.getModel().setRepositoryId( repository.getId() );
record.setArtifact( artifact );
}
catch ( LayoutException e )
{
// Not an artifact.
}