diff options
author | Joakim Erdfelt <joakime@apache.org> | 2007-05-08 16:05:18 +0000 |
---|---|---|
committer | Joakim Erdfelt <joakime@apache.org> | 2007-05-08 16:05:18 +0000 |
commit | c671224fbb399b1cc027c756d58eba8856e6c794 (patch) | |
tree | 80dfd493b1917b2069e060bf1b32e43cc72f3df1 /archiva-base/archiva-consumers/archiva-lucene-consumers | |
parent | 97a323704850ae24f7afbde73141a70e223fe007 (diff) | |
download | archiva-c671224fbb399b1cc027c756d58eba8856e6c794.tar.gz archiva-c671224fbb399b1cc027c756d58eba8856e6c794.zip |
Refactoring RepoContentConsumer into Known vs Invalid to aide in config/scanning
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@536233 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-base/archiva-consumers/archiva-lucene-consumers')
-rw-r--r-- | archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java b/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java index 36ffb1cf2..b71e78f1f 100644 --- a/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java +++ b/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java @@ -21,10 +21,10 @@ package org.apache.maven.archiva.consumers.lucene; import org.apache.commons.io.FileUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; -import org.apache.maven.archiva.configuration.FileType; +import org.apache.maven.archiva.configuration.FileTypes; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; -import org.apache.maven.archiva.consumers.RepositoryContentConsumer; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.maven.archiva.indexer.RepositoryContentIndex; import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; import org.apache.maven.archiva.indexer.RepositoryIndexException; @@ -46,13 +46,13 @@ import java.util.List; * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> * @version $Id$ * - * @plexus.component role="org.apache.maven.archiva.consumers.RepositoryContentConsumer" + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" * role-hint="index-content" * instantiation-strategy="per-lookup" */ public class IndexContentConsumer extends AbstractMonitoredConsumer - implements RepositoryContentConsumer, RegistryListener, Initializable + implements KnownRepositoryContentConsumer, RegistryListener, Initializable { private static final String READ_CONTENT = "read_content"; @@ -72,6 +72,11 @@ public class IndexContentConsumer * @plexus.requirement */ private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; /** * @plexus.requirement @@ -167,12 +172,7 @@ public class IndexContentConsumer { includes.clear(); - FileType artifactTypes = configuration.getConfiguration().getRepositoryScanning() - .getFileTypeById( "indexable-content" ); - if ( artifactTypes != null ) - { - includes.addAll( artifactTypes.getPatterns() ); - } + includes.addAll( filetypes.getFileTypePatterns( FileTypes.INDEXABLE_CONTENT )); } public void initialize() @@ -188,10 +188,5 @@ public class IndexContentConsumer configuration.addChangeListener( this ); initIncludes(); - - if ( includes.isEmpty() ) - { - throw new InitializationException( "Unable to use " + getId() + " due to empty includes list." ); - } } } |