From ae41cf55fae59b5c76c774bd709708060b523fd0 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Tue, 21 Apr 2020 19:46:10 +0200 Subject: [PATCH] Removing unused method --- .../repository/ManagedRepositoryContent.java | 16 ---------------- .../mock/ManagedRepositoryContentMock.java | 7 ------- .../mock/ManagedRepositoryContentMock.java | 7 ------- .../mock/ManagedRepositoryContentMock.java | 7 ------- .../ManagedDefaultRepositoryContent.java | 17 ----------------- 5 files changed, 54 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java index 3ba9fddb8..e06f62e1c 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java @@ -428,22 +428,6 @@ public interface ManagedRepositoryContent extends RepositoryContent ManagedRepository getRepository(); - /** - *

- * Given a specific {@link VersionedReference}, return the list of available versions for that - * versioned reference. - *

- *

- * NOTE: This is really only useful when working with SNAPSHOTs. - *

- * - * @param reference the versioned reference to work off of. - * @return the set of versions found. - * @throws ContentNotFoundException if the versioned reference does not exist within the repository. - */ - Set getVersions( VersionedReference reference ) - throws ContentNotFoundException, ContentAccessException, LayoutException; - /** * Determines if the artifact referenced exists in the repository. * diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java index 977bad2ed..9f52b8078 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java @@ -40,7 +40,6 @@ import org.springframework.stereotype.Service; import java.nio.file.Path; import java.util.List; -import java.util.Set; import java.util.stream.Stream; /** @@ -236,12 +235,6 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent return repository; } - @Override - public Set getVersions( VersionedReference reference ) throws ContentNotFoundException, ContentAccessException, LayoutException - { - return null; - } - @Override public boolean hasContent( ArtifactReference reference ) throws ContentAccessException { diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java index 92e025886..22ab8656c 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java @@ -45,7 +45,6 @@ import java.nio.file.Paths; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Stream; @@ -258,12 +257,6 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent return repository; } - @Override - public Set getVersions( VersionedReference reference ) throws ContentNotFoundException, ContentAccessException, LayoutException - { - return null; - } - @Override public boolean hasContent( ArtifactReference reference ) throws ContentAccessException { diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java index 68e006247..6d3d60a0f 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java @@ -47,7 +47,6 @@ import java.nio.file.Paths; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Stream; @@ -262,12 +261,6 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent return repository; } - @Override - public Set getVersions( VersionedReference reference ) throws ContentNotFoundException, ContentAccessException, LayoutException - { - return null; - } - @Override public boolean hasContent( ArtifactReference reference ) throws ContentAccessException { diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java index b6852c7ad..af42632d6 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java @@ -67,7 +67,6 @@ import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.Optional; -import java.util.Set; import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -1170,22 +1169,6 @@ public class ManagedDefaultRepositoryContent return repository; } - @Override - public Set getVersions( VersionedReference reference ) - throws ContentNotFoundException, ContentAccessException, LayoutException - { - try(Stream stream = newArtifactStream( reference )) - { - return stream.filter( Objects::nonNull ) - .map( ar -> ar.getVersion( ) ) - .collect( Collectors.toSet( ) ); - } catch (IOException e) { - final String path = toPath( reference ); - log.error("Could not read directory from repository {} - {}: ", getId(), path, e.getMessage(), e); - throw new ContentAccessException( "Could not read path for repository "+getId()+": "+ path, e ); - } - } - @Override public boolean hasContent( ArtifactReference reference ) throws ContentAccessException {