From b942314aa27330a179acf17300fea6849bf89d4d Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Sun, 7 Jun 2020 19:32:53 +0200 Subject: Removing unused repository API method --- .../archiva/repository/RepositoryContent.java | 11 ---------- .../mock/ManagedRepositoryContentMock.java | 6 ------ .../mock/RemoteRepositoryContentMock.java | 6 ------ .../scanner/mock/ManagedRepositoryContentMock.java | 24 ---------------------- 4 files changed, 47 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContent.java index fd92be1a2..c30550eb3 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContent.java @@ -30,17 +30,6 @@ public interface RepositoryContent { - /** - * Given a repository relative path to a filename, return the {@link ArtifactReference} object suitable for the path. - * - * @param path the path relative to the repository base dir for the artifact. - * @return the {@link ArtifactReference} representing the path. (or null if path cannot be converted to - * a {@link ArtifactReference}) - * @throws LayoutException if there was a problem converting the path to an artifact. - */ - ArtifactReference toArtifactReference( String path ) - throws LayoutException; - /** * Given an {@link ArtifactReference}, return the relative path to the artifact. * 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 bab83734d..2a2bf398d 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 @@ -321,12 +321,6 @@ public class ManagedRepositoryContentMock implements BaseRepositoryContentLayout this.repository = repo; } - @Override - public ArtifactReference toArtifactReference( String path ) throws LayoutException - { - return null; - } - @Override public String toPath( ArtifactReference reference ) { diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java index bdf951f49..1b9a85732 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java @@ -59,12 +59,6 @@ public class RemoteRepositoryContentMock implements RemoteRepositoryContent this.repository = repo; } - @Override - public ArtifactReference toArtifactReference( String path ) throws LayoutException - { - return null; - } - @Override public String toPath( ArtifactReference reference ) { 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 5deb975e7..054d09561 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 @@ -336,30 +336,6 @@ public class ManagedRepositoryContentMock implements BaseRepositoryContentLayout private Map refs = new HashMap<>(); - @Override - public ArtifactReference toArtifactReference( String path ) throws LayoutException - { - if ( StringUtils.isBlank( path ) ) - { - throw new LayoutException( "Unable to convert blank path." ); - } - - ArtifactMetadata metadata = getArtifactForPath("test-repository", path); - - ArtifactReference artifact = new ArtifactReference(); - artifact.setGroupId( metadata.getNamespace() ); - artifact.setArtifactId( metadata.getProject() ); - artifact.setVersion( metadata.getVersion() ); - MavenArtifactFacet facet = (MavenArtifactFacet) metadata.getFacet( MavenArtifactFacet.FACET_ID ); - if ( facet != null ) - { - artifact.setClassifier( facet.getClassifier() ); - artifact.setType( facet.getType() ); - } - refs.put(artifact, path); - return artifact; - } - public ArtifactMetadata getArtifactForPath( String repoId, String relativePath ) { String[] parts = relativePath.replace( '\\', '/' ).split( "/" ); -- cgit v1.2.3