From f73e942e0ad2406fd81355855eca344fafd29857 Mon Sep 17 00:00:00 2001 From: Martin Schreier Date: Tue, 11 Jan 2022 23:17:58 +0100 Subject: Refactoring of repository feature interface --- .../apache/archiva/rest/api/v2/model/MavenManagedRepository.java | 6 +++--- .../org/apache/archiva/rest/api/v2/model/RepositoryGroup.java | 2 +- .../archiva/rest/api/v2/model/map/MavenRepositoryMapper.java | 4 ++-- .../java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'archiva-modules/archiva-web') 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