From 7adddbe141186225bc33e918727ceb3bed6646f3 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Thu, 9 May 2019 22:58:14 +0200 Subject: Changing maven implementation to new RequestInfo interface --- .../main/java/org/apache/archiva/repository/ManagedRepository.java | 7 +++++++ .../src/main/java/org/apache/archiva/repository/Repository.java | 1 + .../java/org/apache/archiva/repository/RepositoryRequestInfo.java | 2 +- .../java/org/apache/archiva/repository/BasicManagedRepository.java | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepository.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepository.java index 1dea02bb1..3acd16198 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepository.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepository.java @@ -47,4 +47,11 @@ public interface ManagedRepository extends Repository { */ Set getActiveReleaseSchemes(); + + /** + * Returns the request info object, which you can use for gathering information from the web request path. + * @return Instance of a request info object that corresponds to this repository + */ + RepositoryRequestInfo getRequestInfo(); + } diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/Repository.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/Repository.java index f80f94b0d..384639821 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/Repository.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/Repository.java @@ -180,4 +180,5 @@ public interface Repository extends RepositoryEventHandler { */ void close(); + } diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryRequestInfo.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryRequestInfo.java index 043c09cce..ecc97b844 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryRequestInfo.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryRequestInfo.java @@ -118,7 +118,7 @@ public interface RepositoryRequestInfo * @return the adjusted (to native) path. * @throws LayoutException if the path cannot be parsed. */ - void toNativePath( String requestPath); + String toNativePath( String requestPath) throws LayoutException; /** * Extension method that allows to provide different features that are not supported by all diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/BasicManagedRepository.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/BasicManagedRepository.java index d424862a9..d45daead6 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/BasicManagedRepository.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/BasicManagedRepository.java @@ -80,4 +80,9 @@ public class BasicManagedRepository extends AbstractManagedRepository return CAPABILITIES; } + + @Override + public RepositoryRequestInfo getRequestInfo() { + return null; + } } -- cgit v1.2.3