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