aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-maven/archiva-maven-repository/src
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2020-06-16 19:33:30 +0200
committerMartin Stockhammer <martin_s@apache.org>2020-06-16 19:33:30 +0200
commitadd9451d9eb36a753051ea7ff007ea85b500198f (patch)
treeb172eb59c173315f46cddb0bcde2bf327f57f7a2 /archiva-modules/archiva-maven/archiva-maven-repository/src
parentbb0bc93d802209089a4e32abf7749f1f69f4a244 (diff)
downloadarchiva-add9451d9eb36a753051ea7ff007ea85b500198f.tar.gz
archiva-add9451d9eb36a753051ea7ff007ea85b500198f.zip
Cleanup of API and dependencies
Diffstat (limited to 'archiva-modules/archiva-maven/archiva-maven-repository/src')
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java72
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/AbstractRepositoryContentTest.java8
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java7
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenRepositoryRequestInfoTest.java7
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContentTest.java3
5 files changed, 8 insertions, 89 deletions
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 07affa7c4..231665e8d 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
@@ -23,7 +23,6 @@ import org.apache.archiva.common.utils.FileUtils;
import org.apache.archiva.common.utils.VersionUtil;
import org.apache.archiva.configuration.FileTypes;
import org.apache.archiva.metadata.maven.MavenMetadataReader;
-import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.BaseRepositoryContentLayout;
import org.apache.archiva.repository.ContentAccessException;
import org.apache.archiva.repository.EditableManagedRepository;
@@ -57,10 +56,8 @@ import org.apache.commons.lang3.StringUtils;
import javax.inject.Inject;
import javax.inject.Named;
import java.io.IOException;
-import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -1549,75 +1546,6 @@ public class ManagedDefaultRepositoryContent
return repository.getId( );
}
- /*
- * Create the filter for various combinations of classifier and type
- */
- private Predicate<ArtifactReference> getChecker( ArtifactReference referenceObject, String extension )
- {
- // TODO: Check, if extension is the correct parameter here
- // We compare type with extension which works for artifacts like .jar.md5 but may
- // be not the best way.
-
- if ( referenceObject.getClassifier( ) != null && referenceObject.getType( ) != null )
- {
- return ( ( ArtifactReference a ) ->
- referenceObject.getGroupId( ).equals( a.getGroupId( ) )
- && referenceObject.getArtifactId( ).equals( a.getArtifactId( ) )
- && referenceObject.getVersion( ).equals( a.getVersion( ) )
- && ( ( a.getType( ) == null )
- || referenceObject.getType( ).equals( a.getType( ) )
- || a.getType( ).startsWith( extension ) )
- && referenceObject.getClassifier( ).equals( a.getClassifier( ) )
- );
- }
- else if ( referenceObject.getClassifier( ) != null && referenceObject.getType( ) == null )
- {
- return ( ( ArtifactReference a ) ->
- referenceObject.getGroupId( ).equals( a.getGroupId( ) )
- && referenceObject.getArtifactId( ).equals( a.getArtifactId( ) )
- && referenceObject.getVersion( ).equals( a.getVersion( ) )
- && referenceObject.getClassifier( ).equals( a.getClassifier( ) )
- );
- }
- else if ( referenceObject.getClassifier( ) == null && referenceObject.getType( ) != null )
- {
- return ( ( ArtifactReference a ) ->
- referenceObject.getGroupId( ).equals( a.getGroupId( ) )
- && referenceObject.getArtifactId( ).equals( a.getArtifactId( ) )
- && referenceObject.getVersion( ).equals( a.getVersion( ) )
- && ( ( a.getType( ) == null )
- || referenceObject.getType( ).equals( a.getType( ) )
- || a.getType( ).startsWith( extension ) )
- );
- }
- else
- {
- return ( ( ArtifactReference a ) ->
- referenceObject.getGroupId( ).equals( a.getGroupId( ) )
- && referenceObject.getArtifactId( ).equals( a.getArtifactId( ) )
- && referenceObject.getVersion( ).equals( a.getVersion( ) )
- );
- }
-
-
- }
-
- private String convertUriToPath( URI uri )
- {
- if ( uri.getScheme( ) == null )
- {
- return Paths.get( uri.getPath( ) ).toString( );
- }
- else if ( "file".equals( uri.getScheme( ) ) )
- {
- return Paths.get( uri ).toString( );
- }
- else
- {
- return uri.toString( );
- }
- }
-
@Override
public ManagedRepository getRepository( )
{
diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/AbstractRepositoryContentTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/AbstractRepositoryContentTest.java
index 0a18de76c..8c84dbe23 100644
--- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/AbstractRepositoryContentTest.java
+++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/AbstractRepositoryContentTest.java
@@ -18,19 +18,17 @@ package org.apache.archiva.repository.maven.content;
* under the License.
*/
-import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.repository.BaseRepositoryContentLayout;
+import org.apache.archiva.repository.LayoutException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContent;
-import org.apache.archiva.repository.content.base.ArchivaArtifact;
-import org.apache.archiva.repository.maven.AbstractRepositoryLayerTestCase;
-import org.apache.archiva.repository.LayoutException;
-import org.apache.archiva.repository.BaseRepositoryContentLayout;
import org.apache.archiva.repository.content.Artifact;
import org.apache.archiva.repository.content.ItemSelector;
import org.apache.archiva.repository.content.Namespace;
import org.apache.archiva.repository.content.Project;
import org.apache.archiva.repository.content.Version;
import org.apache.archiva.repository.content.base.ArchivaItemSelector;
+import org.apache.archiva.repository.maven.AbstractRepositoryLayerTestCase;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java
index 279a26c5d..48ec82ab0 100644
--- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java
+++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java
@@ -25,14 +25,11 @@ import org.apache.archiva.configuration.FileType;
import org.apache.archiva.configuration.FileTypes;
import org.apache.archiva.metadata.maven.MavenMetadataReader;
import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
-import org.apache.archiva.model.ArtifactReference;
-import org.apache.archiva.model.ProjectReference;
-import org.apache.archiva.model.VersionedReference;
+import org.apache.archiva.repository.BaseRepositoryContentLayout;
import org.apache.archiva.repository.EditableManagedRepository;
-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.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContent;
import org.apache.archiva.repository.content.Artifact;
import org.apache.archiva.repository.content.BaseArtifactTypes;
diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenRepositoryRequestInfoTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenRepositoryRequestInfoTest.java
index cfd5814d7..759fd134c 100644
--- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenRepositoryRequestInfoTest.java
+++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenRepositoryRequestInfoTest.java
@@ -24,13 +24,12 @@ import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.configuration.FileType;
import org.apache.archiva.configuration.FileTypes;
import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
-import org.apache.archiva.repository.ManagedRepositoryContent;
-import org.apache.archiva.repository.content.ItemSelector;
-import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider;
-import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.LayoutException;
+import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentProvider;
+import org.apache.archiva.repository.content.ItemSelector;
import org.apache.archiva.repository.maven.MavenManagedRepository;
+import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.apache.commons.lang3.StringUtils;
import org.junit.Before;
diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContentTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContentTest.java
index 827c8c832..5e49c14a1 100644
--- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContentTest.java
+++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContentTest.java
@@ -19,12 +19,9 @@ package org.apache.archiva.repository.maven.content;
*/
import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
-import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.LayoutException;
-import org.apache.archiva.repository.BaseRepositoryContentLayout;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RemoteRepository;
-import org.apache.archiva.repository.RemoteRepositoryContent;
import org.apache.archiva.repository.RepositoryContent;
import org.apache.archiva.repository.content.Artifact;
import org.apache.archiva.repository.content.ItemSelector;