repoContent =
repoFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() );
}
catch ( RepositoryException e )
{
throw new ConsumerException( "Can't run index cleanup consumer: " + e.getMessage() );
}
ManagedRepositoryConfiguration repository = repoContent.getRepository();
try
{
File artifactFile = new File( repoContent.getRepoRoot(), repoContent.toPath( artifact ) );
if ( !artifactFile.exists() )
{
ArtifactIndexingTask task =
TaskCreator.createIndexingTask( repository.getId(), artifactFile, ArtifactIndexingTask.DELETE );
log.debug( "Queueing indexing task '" + task.getName() + "' to remove the artifact from the index." );
scheduler.queueIndexingTask( task );
}
}
catch ( TaskQueueException e )
{
throw new ConsumerException( e.getMessage() );
}
}