]> source.dussan.org Git - archiva.git/commitdiff
Changing event api
authorMartin Stockhammer <martin.stockhammer@ars.de>
Tue, 27 Mar 2018 05:56:12 +0000 (07:56 +0200)
committerMartin Stockhammer <martin.stockhammer@ars.de>
Tue, 27 Mar 2018 05:56:12 +0000 (07:56 +0200)
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/maven2/MavenManagedRepository.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/maven2/MavenRemoteRepository.java
archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/index/mock/ArchivaIndexManagerMock.java

index 46dec05bf307ec8af427d5ebf8086c2e729cea02..05f877142e639a8d62e845f20ebde1380302f974 100644 (file)
@@ -76,7 +76,7 @@ public class MavenManagedRepository extends AbstractManagedRepository
     public MavenManagedRepository( String id, String name, Path basePath )
     {
         super( RepositoryType.MAVEN, id, name, basePath);
-        this.indexCreationFeature = new IndexCreationFeature(id, this);
+        this.indexCreationFeature = new IndexCreationFeature(this, this);
     }
 
     public MavenManagedRepository( Locale primaryLocale, String id, String name, Path basePath )
index f549e46dd62a8187cc892b31b8e056ee1b56f921..55305ca091aa2d943317182a857071cd1c310dc6 100644 (file)
@@ -64,14 +64,14 @@ public class MavenRemoteRepository extends AbstractRemoteRepository
     public MavenRemoteRepository( String id, String name, Path basePath )
     {
         super( RepositoryType.MAVEN, id, name, basePath );
-        this.indexCreationFeature = new IndexCreationFeature(id, this);
+        this.indexCreationFeature = new IndexCreationFeature(this, this);
 
     }
 
     public MavenRemoteRepository( Locale primaryLocale, String id, String name, Path basePath )
     {
         super( primaryLocale, RepositoryType.MAVEN, id, name, basePath );
-        this.indexCreationFeature = new IndexCreationFeature(id, this);
+        this.indexCreationFeature = new IndexCreationFeature(this, this);
     }
 
     @Override
index 72114947da2bf8b7a32b0f5cf9fa6768acab26e9..f6f59250d700c710e92aaa99b0b79577b01d3eba 100644 (file)
@@ -495,6 +495,19 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager {
         }
     }
 
+    @Override
+    public void updateLocalIndexPath(Repository repo) {
+        if (repo.supportsFeature(IndexCreationFeature.class)) {
+            IndexCreationFeature icf = repo.getFeature(IndexCreationFeature.class).get();
+            try {
+                icf.setLocalIndexPath(getIndexPath(repo));
+            } catch (IOException e) {
+                log.error("Could not set local index path for {}. New URI: {}", repo.getId(), icf.getIndexPath());
+            }
+        }
+    }
+
+
     private Path getIndexPath(Repository repo) throws IOException {
         IndexCreationFeature icf = repo.getFeature(IndexCreationFeature.class).get();
         Path repoDir = repo.getLocalPath();