diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-06-16 08:05:52 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-06-16 08:05:52 +0200 |
commit | fbca0e89f9db5d20dcb096d2fbf7391160f48fd2 (patch) | |
tree | 37bc779c48ea3bcdcb57a60fe24724da07a09188 | |
parent | 628e67094518645923c0b12504cf6925b9e2c839 (diff) | |
download | archiva-fbca0e89f9db5d20dcb096d2fbf7391160f48fd2.tar.gz archiva-fbca0e89f9db5d20dcb096d2fbf7391160f48fd2.zip |
API cleanup
6 files changed, 0 insertions, 92 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java index 246e3343b..3c58aae73 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java @@ -72,11 +72,4 @@ public interface RemoteRepositoryContent extends RepositoryContent */ void setRepository( RemoteRepository repo ); - /** - * Given an ArtifactReference, return the url to the artifact. - * - * @param reference the artifact reference to use. - * @return the relative path to the artifact. - */ - RepositoryURL toURL( ArtifactReference reference ); } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArtifactUtil.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArtifactUtil.java deleted file mode 100644 index 14a14db4c..000000000 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArtifactUtil.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.apache.archiva.repository.content.base; -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.repository.ManagedRepositoryContent; -import org.apache.archiva.repository.LayoutException; -import org.apache.archiva.repository.ManagedRepository; -import org.apache.archiva.repository.BaseRepositoryContentLayout; -import org.apache.archiva.repository.RepositoryContentFactory; -import org.apache.archiva.repository.RepositoryException; -import org.apache.archiva.repository.storage.StorageAsset; -import org.springframework.stereotype.Service; - -import javax.inject.Inject; -import java.nio.file.Path; -import java.nio.file.Paths; - -/** - * Utility class that gives information about the physical location of artifacts. - */ -@Service( "ArtifactUtil#default" ) -public class ArtifactUtil -{ - - @Inject - RepositoryContentFactory repositoryContentFactory; - - /** - * Returns the physical location of a given artifact in the repository. There is no check for the - * existence of the returned file. - * - * @param repository The repository, where the artifact is stored. - * @param artifactReference The artifact reference. - * @return The asset representation of the artifact. - * @throws RepositoryException - */ - public StorageAsset getArtifactAsset( ManagedRepository repository, ArtifactReference artifactReference ) throws RepositoryException - { - final ManagedRepositoryContent content = repositoryContentFactory.getManagedRepositoryContent( repository ); - final String artifactPath; - artifactPath = content.toPath( artifactReference ); - return repository.getAsset( artifactPath ); - } - -} 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 1b9a85732..3fc507a6f 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 @@ -77,9 +77,4 @@ public class RemoteRepositoryContentMock implements RemoteRepositoryContent return null; } - @Override - public RepositoryURL toURL( ArtifactReference reference ) - { - return null; - } } diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java index 168ed3dbc..9312aaa68 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java @@ -99,9 +99,4 @@ public class RemoteRepositoryContentMock implements RemoteRepositoryContent return null; } - @Override - public RepositoryURL toURL( ArtifactReference reference ) - { - return null; - } } diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java index ba8639b2a..532062948 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java @@ -18,15 +18,10 @@ package org.apache.archiva.repository.maven.content; * under the License. */ -import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.RepositoryURL; -import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.RemoteRepository; import org.apache.archiva.repository.RemoteRepositoryContent; -import java.util.List; - /** * RemoteDefaultRepositoryContent */ @@ -73,11 +68,4 @@ public class RemoteDefaultRepositoryContent this.repository = repository; } - @Override - public RepositoryURL toURL( ArtifactReference reference ) - { - String url = repository.getLocation( ) + toPath( reference ); - return new RepositoryURL( url ); - } - } diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java index ab25128ed..0dd280731 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java @@ -36,7 +36,6 @@ import org.apache.archiva.model.SnapshotVersion; import org.apache.archiva.repository.ReleaseScheme; import org.apache.archiva.repository.Repository; import org.apache.archiva.repository.RepositoryException; -import org.apache.archiva.repository.RepositoryNotFoundException; import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.RepositoryType; import org.apache.archiva.repository.content.ItemSelector; |