diff options
author | Martin Schreier <martin_s@apache.org> | 2022-01-11 23:17:58 +0100 |
---|---|---|
committer | Martin Schreier <martin_s@apache.org> | 2022-01-11 23:17:58 +0100 |
commit | f73e942e0ad2406fd81355855eca344fafd29857 (patch) | |
tree | 509841ed02cc9b6634b282dd9411a748adc46340 /archiva-modules/archiva-maven/archiva-maven-scheduler | |
parent | 9a102721d6f0e4ef951901427c43f5c0dc936fd7 (diff) | |
download | archiva-f73e942e0ad2406fd81355855eca344fafd29857.tar.gz archiva-f73e942e0ad2406fd81355855eca344fafd29857.zip |
Refactoring of repository feature interface
Diffstat (limited to 'archiva-modules/archiva-maven/archiva-maven-scheduler')
5 files changed, 7 insertions, 7 deletions
diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/ArchivaIndexingTaskExecutor.java b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/ArchivaIndexingTaskExecutor.java index 036151f6f..4279c4a03 100644 --- a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/ArchivaIndexingTaskExecutor.java +++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/ArchivaIndexingTaskExecutor.java @@ -259,7 +259,7 @@ public class ArchivaIndexingTaskExecutor if ( repository.supportsFeature( IndexCreationFeature.class ) ) { - IndexCreationFeature icf = repository.getFeature( IndexCreationFeature.class ).get( ); + IndexCreationFeature icf = repository.getFeature( IndexCreationFeature.class ); if ( !icf.isSkipPackedIndexCreation( ) && icf.getLocalPackedIndexPath( ) != null && icf.getLocalIndexPath().getFilePath()!=null ) { diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java index a5aee2ebe..9b716ecfa 100644 --- a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java +++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java @@ -96,7 +96,7 @@ public class DefaultDownloadRemoteIndexScheduler { continue; } - RemoteIndexFeature rif = remoteRepository.getFeature(RemoteIndexFeature.class).get(); + RemoteIndexFeature rif = remoteRepository.getFeature( RemoteIndexFeature.class ); // TODO record jobs from configuration @@ -133,7 +133,7 @@ public class DefaultDownloadRemoteIndexScheduler log.warn("ignore scheduleDownloadRemote for repo with id {}. Does not support remote index.", repositoryId); return; } - RemoteIndexFeature rif = remoteRepo.getFeature(RemoteIndexFeature.class).get(); + RemoteIndexFeature rif = remoteRepo.getFeature( RemoteIndexFeature.class ); NetworkProxy networkProxy = null; if ( StringUtils.isNotBlank( rif.getProxyId() ) ) { diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/DownloadRemoteIndexTask.java b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/DownloadRemoteIndexTask.java index d853e9644..45df6e05d 100644 --- a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/DownloadRemoteIndexTask.java +++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/DownloadRemoteIndexTask.java @@ -121,7 +121,7 @@ public class DownloadRemoteIndexTask if (!this.remoteRepository.supportsFeature(RemoteIndexFeature.class)) { throw new RepositoryException("Repository does not support RemotIndexFeature "+remoteRepository.getId()); } - RemoteIndexFeature rif = this.remoteRepository.getFeature(RemoteIndexFeature.class).get(); + RemoteIndexFeature rif = this.remoteRepository.getFeature( RemoteIndexFeature.class ); IndexingContext indexingContext = this.remoteRepository.getIndexingContext().getBaseContext(IndexingContext.class); // create a temp directory to download files tempIndexDirectory = Paths.get(indexingContext.getIndexDirectoryFile().getParent(), ".tmpIndex" ); diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/maven/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/maven/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java index 815a8138d..d1d59c570 100644 --- a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/maven/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/maven/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java @@ -279,7 +279,7 @@ public class ArchivaIndexingTaskExecutorTest { Path basePath = repo.getRoot().getFilePath(); - IndexCreationFeature icf = repo.getFeature( IndexCreationFeature.class ).get(); + IndexCreationFeature icf = repo.getFeature( IndexCreationFeature.class ); StorageAsset packedIndexDirectory = icf.getLocalPackedIndexPath(); StorageAsset indexerDirectory = icf.getLocalIndexPath(); diff --git a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/maven/scheduler/indexing/DownloadRemoteIndexTaskTest.java b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/maven/scheduler/indexing/DownloadRemoteIndexTaskTest.java index 1358a80ee..fd9f39b03 100644 --- a/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/maven/scheduler/indexing/DownloadRemoteIndexTaskTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/java/org/apache/archiva/maven/scheduler/indexing/DownloadRemoteIndexTaskTest.java @@ -189,12 +189,12 @@ public class DownloadRemoteIndexTaskTest Files.createDirectories( indexDirectory ); remoteRepository.setLocation( new URI( "http://localhost:" + port ) ); repoDirectory.toFile().deleteOnExit(); - RemoteIndexFeature rif = remoteRepository.getFeature( RemoteIndexFeature.class ).get(); + RemoteIndexFeature rif = remoteRepository.getFeature( RemoteIndexFeature.class ); rif.setDownloadRemoteIndex( true ); rif.setIndexUri( new URI("http://localhost:" + port + "/index-updates/" ) ); createIndexingContext( remoteRepository ); - // IndexCreationFeature icf = remoteRepository.getFeature( IndexCreationFeature.class ).get( ); + // IndexCreationFeature icf = remoteRepository.getFeature( IndexCreationFeature.class ); // icf.setLocalIndexPath( remoteRepository.getAsset( "index" ) ); return remoteRepository; } |