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-web/archiva-rest | |
parent | 9a102721d6f0e4ef951901427c43f5c0dc936fd7 (diff) | |
download | archiva-f73e942e0ad2406fd81355855eca344fafd29857.tar.gz archiva-f73e942e0ad2406fd81355855eca344fafd29857.zip |
Refactoring of repository feature interface
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest')
3 files changed, 6 insertions, 6 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/MavenManagedRepository.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/MavenManagedRepository.java index ba76efb85..01ec552c0 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/MavenManagedRepository.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/MavenManagedRepository.java @@ -84,16 +84,16 @@ public class MavenManagedRepository extends Repository repo.setName( beanRepo.getName()); repo.setScanned( beanRepo.isScanned() ); repo.setSchedulingDefinition( beanRepo.getSchedulingDefinition() ); - ArtifactCleanupFeature artifactCleanupFeature = beanRepo.getFeature( ArtifactCleanupFeature.class ).get( ); + ArtifactCleanupFeature artifactCleanupFeature = beanRepo.getFeature( ArtifactCleanupFeature.class ); repo.setDeleteSnapshotsOfRelease( artifactCleanupFeature.isDeleteReleasedSnapshots()); repo.setRetentionCount( artifactCleanupFeature.getRetentionCount()); repo.setRetentionPeriod( artifactCleanupFeature.getRetentionPeriod() ); - IndexCreationFeature icf = beanRepo.getFeature( IndexCreationFeature.class ).get( ); + IndexCreationFeature icf = beanRepo.getFeature( IndexCreationFeature.class ); repo.setIndex( icf.hasIndex( ) ); repo.setIndexPath( icf.getIndexPath( ).getPath( ) ); repo.setPackedIndexPath( icf.getPackedIndexPath( ).getPath( ) ); repo.setSkipPackedIndexCreation( icf.isSkipPackedIndexCreation() ); - StagingRepositoryFeature srf = beanRepo.getFeature( StagingRepositoryFeature.class ).get( ); + StagingRepositoryFeature srf = beanRepo.getFeature( StagingRepositoryFeature.class ); repo.setHasStagingRepository( srf.isStageRepoNeeded( ) ); repo.setStagingRepository( srf.getStagingRepository()!=null?srf.getStagingRepository().getId():"" ); } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RepositoryGroup.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RepositoryGroup.java index 1572d7cd6..907b3873c 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RepositoryGroup.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RepositoryGroup.java @@ -75,7 +75,7 @@ public class RepositoryGroup implements Serializable, RestModel result.setLocation( modelObj.getLocation().toString() ); result.setRepositories( modelObj.getRepositories().stream().map( Repository::getId ).collect( Collectors.toList()) ); if (modelObj.supportsFeature( IndexCreationFeature.class )) { - IndexCreationFeature icf = modelObj.getFeature( IndexCreationFeature.class ).get(); + IndexCreationFeature icf = modelObj.getFeature( IndexCreationFeature.class ); mergeConfig.setMergedIndexPath( icf.getIndexPath( ).toString() ); mergeConfig.setMergedIndexTtlMinutes( modelObj.getMergedIndexTTL( ) ); mergeConfig.setIndexMergeSchedule( modelObj.getSchedulingDefinition() ); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/MavenRepositoryMapper.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/MavenRepositoryMapper.java index 305e8e798..d9f00fc4d 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/MavenRepositoryMapper.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/MavenRepositoryMapper.java @@ -74,8 +74,8 @@ public class MavenRepositoryMapper extends RestServiceMapper<MavenManagedReposit public MavenManagedRepository reverseMap( ManagedRepository source ) { MavenManagedRepository result = new MavenManagedRepository( ); - StagingRepositoryFeature srf = source.getFeature( StagingRepositoryFeature.class ).get( ); - ArtifactCleanupFeature acf = source.getFeature( ArtifactCleanupFeature.class ).get( ); + StagingRepositoryFeature srf = source.getFeature( StagingRepositoryFeature.class ); + ArtifactCleanupFeature acf = source.getFeature( ArtifactCleanupFeature.class ); result.setHasStagingRepository( srf.isStageRepoNeeded() ); result.setBlocksRedeployments( source.blocksRedeployments() ); result.setIndex( source.hasIndex() ); |