aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2019-08-03 21:00:48 +0200
committerMartin Stockhammer <martin_s@apache.org>2019-08-03 21:00:48 +0200
commitee2c1a7b2b623cf76c8a5deff5e8ddb836de2eaa (patch)
tree8a2f7bfd2f20b6a6457fb77fbb192cd683d1bddb /archiva-modules/archiva-base
parent34806cdf355267100c8a59c2be245e53805e0225 (diff)
downloadarchiva-ee2c1a7b2b623cf76c8a5deff5e8ddb836de2eaa.tar.gz
archiva-ee2c1a7b2b623cf76c8a5deff5e8ddb836de2eaa.zip
Fixing paths in unit tests
Diffstat (limited to 'archiva-modules/archiva-base')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/Repository.java16
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRemoteRepository.java5
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepository.java15
3 files changed, 10 insertions, 26 deletions
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 d6c38a04d..cc43ab262 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
@@ -22,6 +22,7 @@ package org.apache.archiva.repository;
import org.apache.archiva.indexer.ArchivaIndexingContext;
import org.apache.archiva.repository.storage.RepositoryStorage;
import org.apache.archiva.repository.features.RepositoryFeature;
+import org.apache.archiva.repository.storage.StorageAsset;
import java.net.URI;
import java.nio.file.Path;
@@ -89,19 +90,12 @@ public interface Repository extends RepositoryEventHandler, RepositoryStorage {
/**
- * Returns the local path that this repository uses, if it stores data locally. You should keep in
- * mind, that repository implementations may not store any data in this directory. E.g. if the
- * repository data is handled by a database. So the content of this directory is very implementation
- * specific. Users of this directory must know about the repository file layout if they use this
- * path.
+ * Returns a storage representation to the local data stored for this repository.
+ * The repository implementation may not store the real artifacts in this path. The directory structure
+ * is completely implementation dependant.
*
- * Repository implementations should always return a valid path, even if there is no locally stored data.
- *
- * Some extensions may use the path to store their own repository specific data, e.g. statistics, metadata,...
- *
- * @return the filesystem path to the repository.
*/
- Path getLocalPath();
+ StorageAsset getLocalPath();
/**
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRemoteRepository.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRemoteRepository.java
index ee324f2c4..5e58f547c 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRemoteRepository.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRemoteRepository.java
@@ -21,6 +21,7 @@ package org.apache.archiva.repository;
import org.apache.archiva.repository.storage.RepositoryStorage;
+import org.apache.archiva.repository.storage.StorageAsset;
import java.net.URI;
import java.nio.file.Path;
@@ -147,8 +148,8 @@ public abstract class AbstractRemoteRepository extends AbstractRepository implem
* @return
*/
@Override
- public Path getLocalPath() {
- return getStorage().getAsset("").getFilePath();
+ public StorageAsset getLocalPath() {
+ return getStorage().getAsset("");
}
@Override
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepository.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepository.java
index cb1d9f7e3..f735ced88 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepository.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepository.java
@@ -147,19 +147,8 @@ public abstract class AbstractRepository implements EditableRepository, Reposito
}
@Override
- public Path getLocalPath() {
- return storage.getAsset("").getFilePath();
-// Path localPath;
-// if (StringUtils.isEmpty(getLocation().getScheme()) || "file".equals(getLocation().getScheme()) ) {
-// localPath = PathUtil.getPathFromUri(getLocation());
-// if (localPath.isAbsolute()) {
-// return localPath;
-// } else {
-// return repositoryBase.resolve(localPath);
-// }
-// } else {
-// return repositoryBase.resolve(getId());
-// }
+ public StorageAsset getLocalPath() {
+ return storage.getAsset("");
}
@Override