diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-06-03 16:03:29 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-06-03 16:03:29 +0200 |
commit | cb0e5f8eeab97320617eeb026be5e47d0ab50af8 (patch) | |
tree | 7c2e413d36abedd3b6112375e5c38f028a477c0a /archiva-modules/archiva-base/archiva-repository-layer | |
parent | d8f55d0c99feccb781d0b02954023bb0af4fb35b (diff) | |
download | archiva-cb0e5f8eeab97320617eeb026be5e47d0ab50af8.tar.gz archiva-cb0e5f8eeab97320617eeb026be5e47d0ab50af8.zip |
Removing method from repository layout
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-layer')
2 files changed, 8 insertions, 13 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/base/MetadataTools.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/base/MetadataTools.java index a31554bb1..a9eebef59 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/base/MetadataTools.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/base/MetadataTools.java @@ -937,23 +937,24 @@ public class MetadataTools path = path.substring( 0, idx ); } - Path repoDir = Paths.get( managedRepository.getRepoRoot(), path ); + StorageAsset repoDir = managedRepository.getGenericContent( ).getRepository( ).getAsset( "" ); - if ( !Files.exists(repoDir)) + if ( !repoDir.exists()) { throw new IOException( "Unable to gather the list of snapshot versions on a non-existant directory: " - + repoDir.toAbsolutePath() ); + + repoDir.toString() ); } - if ( !Files.isDirectory( repoDir )) + if ( !repoDir.isContainer()) { throw new IOException( - "Unable to gather the list of snapshot versions on a non-directory: " + repoDir.toAbsolutePath() ); + "Unable to gather the list of snapshot versions on a non-directory: " + repoDir.toString() ); } - try(Stream<Path> stream = Files.list(repoDir)) { + Path repoRoot = repoDir.getFilePath( ); + try(Stream<Path> stream = Files.list(repoRoot)) { String result = stream.filter( Files::isRegularFile ).map( path1 -> - PathUtil.getRelative( managedRepository.getRepoRoot(), path1 ) + repoRoot.relativize( path1 ).toString() ).filter( filetypes::matchesArtifactPattern ).findFirst().orElse( null ); if (result!=null) { return managedRepository.getGenericContent().toArtifactReference( result ); 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 60e8fd35f..69af3d37f 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 @@ -304,12 +304,6 @@ public class ManagedRepositoryContentMock implements BaseRepositoryContentLayout } @Override - public String getRepoRoot( ) - { - return null; - } - - @Override public ManagedRepository getRepository( ) { return repository; |