diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-06-13 20:21:51 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-06-13 20:21:51 +0200 |
commit | 628e67094518645923c0b12504cf6925b9e2c839 (patch) | |
tree | 144d851d8ea14b5a52528c7249e0b02428442db9 /archiva-modules/archiva-base/archiva-repository-layer | |
parent | a548587e47dec678af021f428c80f08ddc728177 (diff) | |
download | archiva-628e67094518645923c0b12504cf6925b9e2c839.tar.gz archiva-628e67094518645923c0b12504cf6925b9e2c839.zip |
Cleanup of APIs
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-layer')
2 files changed, 17 insertions, 17 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArchivaItemSelector.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArchivaItemSelector.java index cb5063087..e36ca2c97 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArchivaItemSelector.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArchivaItemSelector.java @@ -92,6 +92,23 @@ public class ArchivaItemSelector implements ItemSelector return this; } + public Builder withSelector(ItemSelector givenSelector) { + selector.namespace = givenSelector.getNamespace( ); + selector.projectId = givenSelector.getProjectId( ); + selector.version = givenSelector.getVersion( ); + selector.extension = givenSelector.getExtension( ); + selector.artifactId = givenSelector.getArtifactId( ); + selector.artifactVersion = givenSelector.getArtifactVersion( ); + selector.recurse = givenSelector.recurse( ); + for (Map.Entry<String, String> att : givenSelector.getAttributes().entrySet()) { + selector.setAttribute( att.getKey( ), att.getValue( ) ); + } + selector.type = givenSelector.getType( ); + selector.classifier = givenSelector.getClassifier( ); + selector.includeRelatedArtifacts = givenSelector.includeRelatedArtifacts( ); + return this; + } + public Builder withNamespace( String namespace ) { if (namespace!=null) 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 index fe964b945..14a14db4c 100644 --- 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 @@ -48,23 +48,6 @@ public class ArtifactUtil * * @param repository The repository, where the artifact is stored. * @param artifactReference The artifact reference. - * @return The absolute path to the artifact. - * @throws RepositoryException - */ - public Path getArtifactPath( ManagedRepository repository, ArtifactReference artifactReference ) throws RepositoryException - { - final ManagedRepositoryContent content = repositoryContentFactory.getManagedRepositoryContent( repository ); - final String artifactPath; - artifactPath = content.toPath( artifactReference ); - return Paths.get( repository.getLocation( ) ).resolve( artifactPath ); - } - - /** - * 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 */ |