aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web
diff options
context:
space:
mode:
authorMartin Schreier <martin_s@apache.org>2022-01-11 23:17:58 +0100
committerMartin Schreier <martin_s@apache.org>2022-01-11 23:17:58 +0100
commitf73e942e0ad2406fd81355855eca344fafd29857 (patch)
tree509841ed02cc9b6634b282dd9411a748adc46340 /archiva-modules/archiva-web
parent9a102721d6f0e4ef951901427c43f5c0dc936fd7 (diff)
downloadarchiva-f73e942e0ad2406fd81355855eca344fafd29857.tar.gz
archiva-f73e942e0ad2406fd81355855eca344fafd29857.zip
Refactoring of repository feature interface
Diffstat (limited to 'archiva-modules/archiva-web')
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/MavenManagedRepository.java6
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RepositoryGroup.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/MavenRepositoryMapper.java4
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java8
4 files changed, 10 insertions, 10 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() );
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
index ec79dd5e1..d252e9c2e 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
@@ -416,7 +416,7 @@ public class ArchivaDavResourceFactory
String mergedIndexPath = "/";
if (repoGroup.supportsFeature( IndexCreationFeature.class )) {
- mergedIndexPath = repoGroup.getFeature( IndexCreationFeature.class ).get().getIndexPath().getPath();
+ mergedIndexPath = repoGroup.getFeature( IndexCreationFeature.class ).getIndexPath().getPath();
}
if ( StringUtils.endsWith( rootPath, mergedIndexPath ) )
@@ -1051,7 +1051,7 @@ public class ArchivaDavResourceFactory
String pathInfo = StringUtils.removeEnd( request.getPathInfo(), "/" );
String mergedIndexPath = "/";
if (repositoryGroup.supportsFeature( IndexCreationFeature.class )) {
- IndexCreationFeature indexCreationFeature = repositoryGroup.getFeature( IndexCreationFeature.class ).get();
+ IndexCreationFeature indexCreationFeature = repositoryGroup.getFeature( IndexCreationFeature.class );
mergedIndexPath = indexCreationFeature.getIndexPath().getPath();
}
@@ -1113,7 +1113,7 @@ public class ArchivaDavResourceFactory
if ( resourceFile.exists() && managedRepository.getRepository().supportsFeature( IndexCreationFeature.class ))
{
// in case of group displaying index directory doesn't have sense !!
- IndexCreationFeature idf = managedRepository.getRepository().getFeature(IndexCreationFeature.class).get();
+ IndexCreationFeature idf = managedRepository.getRepository().getFeature( IndexCreationFeature.class );
StorageAsset repoIndexDirectory = idf.getLocalIndexPath();
if ( !StringUtils.equals( FilenameUtils.normalize( repoIndexDirectory.getPath() ),
FilenameUtils.normalize( logicalResource.getPath() ) ) )
@@ -1369,7 +1369,7 @@ public class ArchivaDavResourceFactory
log.info( "generate temporary merged index for repository group '{}' for repositories '{}'",
id, authzRepos );
- IndexCreationFeature indexCreationFeature = repositoryGroup.getFeature( IndexCreationFeature.class ).get();
+ IndexCreationFeature indexCreationFeature = repositoryGroup.getFeature( IndexCreationFeature.class );
Path indexPath = indexCreationFeature.getLocalIndexPath().getFilePath();
if (indexPath!=null)
{