aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2020-06-13 14:03:27 +0200
committerMartin Stockhammer <martin_s@apache.org>2020-06-13 14:03:27 +0200
commitb804db659977514037ea19b2cc473fcba9701a67 (patch)
tree88f66202015701f91ea9c218aeb8a1aa87192937
parentbf95aca967b54c7b0fa24b52a038b5c4256947bb (diff)
downloadarchiva-b804db659977514037ea19b2cc473fcba9701a67.tar.gz
archiva-b804db659977514037ea19b2cc473fcba9701a67.zip
Adding layout method
-rw-r--r--archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java6
-rw-r--r--archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContentLayout.java1
-rw-r--r--archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java9
3 files changed, 16 insertions, 0 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 f4ad5af12..4c06dab85 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
@@ -193,4 +193,10 @@ public interface ManagedRepositoryContent extends RepositoryContent
* @return <code>true</code>, if the layout is supported, otherwise <code>false</code>
*/
<T extends ManagedRepositoryContentLayout> boolean supportsLayout(Class<T> clazz);
+
+ /**
+ * Returns a list of supported layout classes
+ * @return
+ */
+ List<Class<? extends ManagedRepositoryContentLayout>> getSupportedLayouts( );
}
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContentLayout.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContentLayout.java
index 3bc4736b3..d53743d7a 100644
--- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContentLayout.java
+++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContentLayout.java
@@ -48,4 +48,5 @@ public interface ManagedRepositoryContentLayout
* @throws LayoutException if the conversion is not possible
*/
<T extends ContentItem> T adaptItem( Class<T> clazz, ContentItem item ) throws LayoutException;
+
}
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 b66207dd8..72dc336a4 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
@@ -65,6 +65,7 @@ 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;
import java.util.Objects;
@@ -120,6 +121,8 @@ public class ManagedDefaultRepositoryContent
public static final Pattern GENERIC_SNAPSHOT_PATTERN = Pattern.compile( "^(.*)-" + SNAPSHOT );
+ private static final List<Class<? extends ManagedRepositoryContentLayout>> LAYOUTS = Arrays.asList( BaseRepositoryContentLayout.class );
+
/**
* We are caching content items in a weak reference map. To avoid always recreating the
* the hierarchical structure.
@@ -1461,6 +1464,12 @@ public class ManagedDefaultRepositoryContent
return clazz.isAssignableFrom( this.getClass( ) );
}
+ @Override
+ public List<Class<? extends ManagedRepositoryContentLayout>> getSupportedLayouts( )
+ {
+ return LAYOUTS;
+ }
+
/**
* Moves the file to the artifact destination
*/