public void executeConsumers( ManagedRepositoryConfiguration repository, File localFile, boolean updateRelatedArtifacts )
{
// Run the repository consumers
try
{
Closure triggerBeginScan = new TriggerBeginScanClosure( repository, getStartTime() );
List<KnownRepositoryContentConsumer> selectedKnownConsumers = getSelectedKnownConsumers();
// MRM-1212/MRM-1197
// - do not create missing/fix invalid checksums and update metadata when deploying from webdav since these are uploaded by maven
if( updateRelatedArtifacts == false )
{
List<KnownRepositoryContentConsumer> clone = new ArrayList<KnownRepositoryContentConsumer>();
clone.addAll( selectedKnownConsumers );
for( KnownRepositoryContentConsumer consumer : clone )
{
if( consumer.getId().equals( "create-missing-checksums" ) ||
consumer.getId().equals( "metadata-updater" ) )
{
selectedKnownConsumers.remove( consumer );
}
}
}
List<InvalidRepositoryContentConsumer> selectedInvalidConsumers = getSelectedInvalidConsumers();
CollectionUtils.forAllDo( selectedKnownConsumers, triggerBeginScan );
CollectionUtils.forAllDo( selectedInvalidConsumers, triggerBeginScan );
// yuck. In case you can't read this, it says
// "process the file if the consumer has it in the includes list, and not in the excludes list"
BaseFile baseFile = new BaseFile( repository.getLocation(), localFile );
ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate();
predicate.setBasefile( baseFile );
ConsumerProcessFileClosure closure = new ConsumerProcessFileClosure();
closure.setBasefile( baseFile );
predicate.setCaseSensitive( false );
Closure processIfWanted = IfClosure.getInstance( predicate, closure );
CollectionUtils.forAllDo( selectedKnownConsumers, processIfWanted );
if ( predicate.getWantedFileCount() <= 0 )
{