Browse Source

Changing event api

pull/46/head
Martin Stockhammer 6 years ago
parent
commit
4ea420ae99

+ 1
- 1
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/maven2/MavenManagedRepository.java View 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 )

+ 2
- 2
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/maven2/MavenRemoteRepository.java View 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

+ 13
- 0
archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/index/mock/ArchivaIndexManagerMock.java View 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();

Loading…
Cancel
Save