@@ -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 ) |
@@ -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 |
@@ -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(); |