summaryrefslogtreecommitdiffstats
path: root/archiva-reporting
diff options
context:
space:
mode:
authorJoakim Erdfelt <joakime@apache.org>2007-05-08 16:05:18 +0000
committerJoakim Erdfelt <joakime@apache.org>2007-05-08 16:05:18 +0000
commitc671224fbb399b1cc027c756d58eba8856e6c794 (patch)
tree80dfd493b1917b2069e060bf1b32e43cc72f3df1 /archiva-reporting
parent97a323704850ae24f7afbde73141a70e223fe007 (diff)
downloadarchiva-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-reporting')
-rw-r--r--archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactsConsumer.java18
-rw-r--r--archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java13
2 files changed, 16 insertions, 15 deletions
diff --git a/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactsConsumer.java b/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactsConsumer.java
index ad6bb675f..e6715094e 100644
--- a/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactsConsumer.java
+++ b/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactsConsumer.java
@@ -22,7 +22,7 @@ package org.apache.maven.archiva.reporting.artifact;
import org.apache.commons.collections.CollectionUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.ConfigurationNames;
-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.ArchivaArtifactConsumer;
import org.apache.maven.archiva.consumers.ConsumerException;
@@ -32,7 +32,6 @@ import org.apache.maven.archiva.database.ObjectNotFoundException;
import org.apache.maven.archiva.database.constraints.ArtifactsBySha1ChecksumConstraint;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.RepositoryProblem;
-import org.apache.maven.archiva.reporting.artifact.DuplicateArtifactReport;
import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout;
import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayoutFactory;
import org.apache.maven.archiva.repository.layout.LayoutException;
@@ -74,6 +73,11 @@ public class DuplicateArtifactsConsumer
private ArchivaConfiguration configuration;
/**
+ * @plexus.requirement
+ */
+ private FileTypes filetypes;
+
+ /**
* @plexus.requirement role-hint="jdo"
*/
private ArchivaDAO dao;
@@ -149,8 +153,8 @@ public class DuplicateArtifactsConsumer
while ( it.hasNext() )
{
ArchivaArtifact dupArtifact = (ArchivaArtifact) it.next();
-
- if( dupArtifact.equals( artifact ) )
+
+ if ( dupArtifact.equals( artifact ) )
{
// Skip reference to itself.
continue;
@@ -212,11 +216,7 @@ public class DuplicateArtifactsConsumer
{
includes.clear();
- FileType artifactTypes = configuration.getConfiguration().getRepositoryScanning().getFileTypeById( "artifacts" );
- if ( artifactTypes != null )
- {
- includes.addAll( artifactTypes.getPatterns() );
- }
+ includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) );
}
public void initialize()
diff --git a/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java b/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java
index 3a350f54f..06d632b29 100644
--- a/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java
+++ b/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java
@@ -22,7 +22,7 @@ package org.apache.maven.archiva.reporting.artifact;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.ConfigurationNames;
-import org.apache.maven.archiva.configuration.FileType;
+import org.apache.maven.archiva.configuration.FileTypes;
import org.apache.maven.archiva.configuration.RepositoryConfiguration;
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer;
@@ -84,6 +84,11 @@ public class LocationArtifactsConsumer
* @plexus.requirement
*/
private ArchivaConfiguration configuration;
+
+ /**
+ * @plexus.requirement
+ */
+ private FileTypes filetypes;
/**
* @plexus.requirement role-hint="jdo"
@@ -331,11 +336,7 @@ public class LocationArtifactsConsumer
{
includes.clear();
- FileType artifactTypes = configuration.getConfiguration().getRepositoryScanning().getFileTypeById( "artifacts" );
- if ( artifactTypes != null )
- {
- includes.addAll( artifactTypes.getPatterns() );
- }
+ includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) );
}
private void initRepositoryMap()