aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2020-03-07 17:13:03 +0100
committerMartin Stockhammer <martin_s@apache.org>2020-03-07 17:13:03 +0100
commite015e1cd149264deb3a584010daa854357f19929 (patch)
treec22c602ccf8e53f4c3d83d987bae185ea98b4400 /archiva-modules
parent716087e2bfcb607ebeb05c89bf4a7753be13ac6e (diff)
downloadarchiva-e015e1cd149264deb3a584010daa854357f19929.tar.gz
archiva-e015e1cd149264deb3a584010daa854357f19929.zip
Renaming method names
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java25
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java6
-rw-r--r--archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java6
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java6
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java24
5 files changed, 52 insertions, 15 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 6811bb208..a4565c4d4 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
@@ -204,9 +204,10 @@ public interface ManagedRepositoryContent extends RepositoryContent
* given namespace.
*
* @param namespace the namespace, which is the parent namespace
+ * @param recurse <code>true</code>, if all sub namespaces should be searched too, otherwise <code>false</code>
* @return a list of artifacts or a empty list, if no artifacts are available for the specified namespace
*/
- List<? extends Artifact> getArtifactsStartingWith( Namespace namespace ) throws ContentAccessException;
+ List<? extends Artifact> getArtifacts( Namespace namespace, boolean recurse ) throws ContentAccessException;
/**
@@ -231,10 +232,11 @@ public interface ManagedRepositoryContent extends RepositoryContent
* make sure, that the stream is closed after using it.
*
* @param namespace the namespace from where the artifacts should be returned
+ * @param recurse <code>true</code>, if all sub namespaces should be searched too, otherwise <code>false</code>
* @return a stream of artifacts. The stream is auto closable. You should always make sure, that the stream
* is closed after use.
*/
- Stream<? extends Artifact> getArtifactStreamStartingWith( Namespace namespace ) throws ContentAccessException;
+ Stream<? extends Artifact> getArtifactStream( Namespace namespace, boolean recurse ) throws ContentAccessException;
/**
@@ -252,10 +254,27 @@ public interface ManagedRepositoryContent extends RepositoryContent
* @param destination the coordinates of the destination
* @throws IllegalArgumentException if the destination is not valid
*/
- void copyArtifact( Path sourceFile, ItemSelector destination ) throws IllegalArgumentException;
+ void copyArtifact( Path sourceFile, ContentItem destination ) throws IllegalArgumentException;
+ /**
+ * Returns the item that matches the given path. The item at the path must not exist.
+ *
+ * @param path the path string that points to the item
+ * @return the content item if the path is a valid item path
+ * @throws LayoutException if the path is not valid for the repository layout
+ */
+ ContentItem toItem(String path) throws LayoutException;
+
+ /**
+ * Returns the item that matches the given asset path. The asset must not exist.
+ *
+ * @param assetPath the path to the artifact or directory
+ * @return the item, if it is a valid path for the repository layout
+ * @throws LayoutException if the path is not valid for the repository
+ */
+ ContentItem toItem(StorageAsset assetPath) throws LayoutException;
/// ***************** End of new generation interface **********************
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 b5adf5ca5..cc7aac64c 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
@@ -151,7 +151,7 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent
}
@Override
- public List<? extends Artifact> getArtifactsStartingWith( Namespace namespace ) throws ContentAccessException
+ public List<? extends Artifact> getArtifacts( Namespace namespace, boolean recurse ) throws ContentAccessException
{
return null;
}
@@ -163,7 +163,7 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent
}
@Override
- public Stream<? extends Artifact> getArtifactStreamStartingWith( Namespace namespace ) throws ContentAccessException
+ public Stream<? extends Artifact> getArtifactStream( Namespace namespace, boolean recurse ) throws ContentAccessException
{
return null;
}
@@ -175,7 +175,7 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent
}
@Override
- public void copyArtifact( Path sourceFile, ItemSelector destination ) throws IllegalArgumentException
+ public void copyArtifact( Path sourceFile, ContentItem destination ) throws IllegalArgumentException
{
}
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 5d2520ff6..09794b757 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
@@ -152,7 +152,7 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent
}
@Override
- public List<? extends Artifact> getArtifactsStartingWith( Namespace namespace ) throws ContentAccessException
+ public List<? extends Artifact> getArtifacts( Namespace namespace, boolean recurse ) throws ContentAccessException
{
return null;
}
@@ -164,7 +164,7 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent
}
@Override
- public Stream<? extends Artifact> getArtifactStreamStartingWith( Namespace namespace ) throws ContentAccessException
+ public Stream<? extends Artifact> getArtifactStream( Namespace namespace, boolean recurse ) throws ContentAccessException
{
return null;
}
@@ -176,7 +176,7 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent
}
@Override
- public void copyArtifact( Path sourceFile, ItemSelector destination ) throws IllegalArgumentException
+ public void copyArtifact( Path sourceFile, ContentItem destination ) throws IllegalArgumentException
{
}
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 5314c1833..fd655b8e6 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
@@ -156,7 +156,7 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent
}
@Override
- public List<? extends Artifact> getArtifactsStartingWith( Namespace namespace ) throws ContentAccessException
+ public List<? extends Artifact> getArtifacts( Namespace namespace, boolean recurse ) throws ContentAccessException
{
return null;
}
@@ -168,7 +168,7 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent
}
@Override
- public Stream<? extends Artifact> getArtifactStreamStartingWith( Namespace namespace ) throws ContentAccessException
+ public Stream<? extends Artifact> getArtifactStream( Namespace namespace, boolean recurse ) throws ContentAccessException
{
return null;
}
@@ -180,7 +180,7 @@ public class ManagedRepositoryContentMock implements ManagedRepositoryContent
}
@Override
- public void copyArtifact( Path sourceFile, ItemSelector destination ) throws IllegalArgumentException
+ public void copyArtifact( Path sourceFile, ContentItem destination ) throws IllegalArgumentException
{
}
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 e77ba3f3c..e82ce3410 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
@@ -600,7 +600,7 @@ public class ManagedDefaultRepositoryContent
TBD
*/
@Override
- public List<? extends Artifact> getArtifactsStartingWith( Namespace namespace )
+ public List<? extends Artifact> getArtifacts( Namespace namespace, boolean recurse )
{
return null;
}
@@ -618,7 +618,7 @@ public class ManagedDefaultRepositoryContent
TBD
*/
@Override
- public Stream<? extends Artifact> getArtifactStreamStartingWith( Namespace namespace )
+ public Stream<? extends Artifact> getArtifactStream( Namespace namespace, boolean recurse )
{
return null;
}
@@ -636,11 +636,29 @@ public class ManagedDefaultRepositoryContent
TBD
*/
@Override
- public void copyArtifact( Path sourceFile, ItemSelector destination ) throws IllegalArgumentException
+ public void copyArtifact( Path sourceFile, ContentItem destination ) throws IllegalArgumentException
{
}
+ /**
+ * TBD
+ * @param path the path string that points to the item
+ * @return
+ * @throws LayoutException
+ */
+ @Override
+ public ContentItem toItem( String path ) throws LayoutException
+ {
+ return getItemFromPath( getAssetByPath( path ) );
+ }
+
+ @Override
+ public ContentItem toItem( StorageAsset assetPath ) throws LayoutException
+ {
+ return getItemFromPath( assetPath );
+ }
+
@Override
public void deleteVersion( VersionedReference ref ) throws ContentNotFoundException, ContentAccessException
{