{
throw new TaskExecutionException(
"Error while executing purge repository task: no repository set" );
}
PurgeController purgeController = (PurgeController) container.lookup( PurgeController.ROLE,
"purge-repository" );
purgeController.initializeExecutors( repoPurge );
if ( repoPurge.isDeleteAll() )
{
purgeController.doPurge( repoPurge );
}
else
{
scanner.scan( repository, purgeController );
}
}
else if ( purgeConfig != null && purgeConfig instanceof DirectoryPurgeConfiguration )
{
DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;
PurgeController purgeController = (PurgeController) container.lookup( PurgeController.ROLE,
"purge-directory" );
purgeController.initializeExecutors( dirPurge );
purgeController.doPurge( dirPurge.getLocation() );
}
else if ( purgeConfig instanceof DistributedDirectoryPurgeConfiguration )
{
DistributedDirectoryPurgeConfiguration dirPurge = (DistributedDirectoryPurgeConfiguration) purgeConfig;
PurgeController purgeController = (PurgeController) container.lookup( PurgeController.ROLE,
"purge-distributed-directory" );
purgeController.initializeExecutors( dirPurge );
purgeController.doPurge( dirPurge );
}
}
catch ( ComponentLookupException e )
{