synchronized ( consumers )
{
stats.filesIncluded++;
BaseFile basefile = new BaseFile( repository.getBasedir(), file );
Iterator itConsumers = this.consumers.iterator();
while ( itConsumers.hasNext() )
{
Consumer consumer = (Consumer) itConsumers.next();
if ( wantsFile( consumer, StringUtils.replace( basefile.getRelativePath(), "\\", "/" ) ) )
{
try
{
getLogger().debug( "Sending to consumer: " + consumer.getName() );
stats.filesConsumed++;
consumer.processFile( basefile );
}
catch ( Exception e )
{
/* Intentionally Catch all exceptions.
* So that the discoverer processing can continue.
*/
getLogger().error( "Consumer [" + consumer.getName() + "] had an error when processing file [" +
basefile.getAbsolutePath() + "]: " + e.getMessage(), e );
}
}
else
{
getLogger().debug(
"Skipping consumer " + consumer.getName() + " for file " + basefile.getRelativePath() );
}
}
}
}