From 8af86cd884b34ecfa98c6a42d2975fdd45c48fff Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 8 Oct 2007 22:07:39 +0000 Subject: Finishing the Repository split work that brett started. ArchivaRepository has been removed from model. This work was needed before repository layout/detection proposal work is started. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@582987 13f79535-47bb-0310-9956-ffa450edef68 --- .../reporting/artifact/LocationArtifactsConsumer.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'archiva-reporting/archiva-artifact-reports/src/main') 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 f461baf46..e9cc8416b 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 @@ -31,9 +31,7 @@ import org.apache.maven.archiva.database.ArchivaDAO; import org.apache.maven.archiva.database.ArchivaDatabaseException; import org.apache.maven.archiva.model.ArchivaArtifact; import org.apache.maven.archiva.model.ArchivaProjectModel; -import org.apache.maven.archiva.model.ArchivaRepository; import org.apache.maven.archiva.model.RepositoryProblem; -import org.apache.maven.archiva.repository.ArchivaConfigurationAdaptor; import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout; import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayoutFactory; import org.apache.maven.archiva.repository.layout.LayoutException; @@ -142,9 +140,9 @@ public class LocationArtifactsConsumer public void processArchivaArtifact( ArchivaArtifact artifact ) throws ConsumerException { - ArchivaRepository repository = findRepository( artifact ); + ManagedRepositoryConfiguration repository = findRepository( artifact ); - File artifactFile = new File( repository.getUrl().toString(), toPath( artifact ) ); + File artifactFile = new File( repository.getLocation(), toPath( artifact ) ); ArchivaProjectModel fsModel = readFilesystemModel( artifactFile ); ArchivaProjectModel embeddedModel = readEmbeddedModel( artifact, artifactFile ); @@ -287,9 +285,9 @@ public class LocationArtifactsConsumer return new File( pomFilename ); } - private ArchivaRepository findRepository( ArchivaArtifact artifact ) + private ManagedRepositoryConfiguration findRepository( ArchivaArtifact artifact ) { - return (ArchivaRepository) this.repositoryMap.get( artifact.getModel().getRepositoryId() ); + return (ManagedRepositoryConfiguration) this.repositoryMap.get( artifact.getModel().getRepositoryId() ); } private String toPath( ArchivaArtifact artifact ) @@ -337,12 +335,12 @@ public class LocationArtifactsConsumer { this.repositoryMap.clear(); - Map map = + Map map = configuration.getConfiguration().getManagedRepositoriesAsMap(); + for ( Map.Entry entry : map.entrySet() ) { - ArchivaRepository repository = ArchivaConfigurationAdaptor.toArchivaRepository( entry.getValue() ); - this.repositoryMap.put( entry.getKey(), repository ); + this.repositoryMap.put( entry.getKey(), entry.getValue() ); } } } -- cgit v1.2.3