From a39985692c55c85394deb4a075d9de2c066ff2f5 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 7 Oct 2015 12:08:47 +1100 Subject: [PATCH] ooops fix compilation --- .../file/FileMetadataRepository.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java index 2da1a5b6f..da3c44470 100644 --- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java @@ -453,16 +453,23 @@ public class FileMetadataRepository public List getArtifactsByDateRange( String repoId, Date startTime, Date endTime ) throws MetadataRepositoryException { - // TODO: this is quite slow - if we are to persist with this repository implementation we should build an index - // of this information (eg. in Lucene, as before) + try + { + // TODO: this is quite slow - if we are to persist with this repository implementation we should build an index + // of this information (eg. in Lucene, as before) - List artifacts = new ArrayList<>(); - for ( String ns : getRootNamespaces( repoId ) ) + List artifacts = new ArrayList<>(); + for ( String ns : getRootNamespaces( repoId ) ) + { + getArtifactsByDateRange( artifacts, repoId, ns, startTime, endTime ); + } + Collections.sort( artifacts, new ArtifactComparator() ); + return artifacts; + } + catch ( MetadataResolutionException e ) { - getArtifactsByDateRange( artifacts, repoId, ns, startTime, endTime ); + throw new MetadataRepositoryException( e.getMessage(), e ); } - Collections.sort( artifacts, new ArtifactComparator() ); - return artifacts; } private void getArtifactsByDateRange( List artifacts, String repoId, String ns, Date startTime, -- 2.39.5