You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2015/10/07 04:52:54 UTC

[4/6] archiva git commit: ooops fix compilation

ooops fix compilation


Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/a3998569
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/a3998569
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/a3998569

Branch: refs/heads/master
Commit: a39985692c55c85394deb4a075d9de2c066ff2f5
Parents: b195fa3
Author: Olivier Lamy <ol...@apache.org>
Authored: Wed Oct 7 12:08:47 2015 +1100
Committer: Olivier Lamy <ol...@apache.org>
Committed: Wed Oct 7 12:08:47 2015 +1100

----------------------------------------------------------------------
 .../repository/file/FileMetadataRepository.java | 21 +++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/a3998569/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
----------------------------------------------------------------------
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 2da1a5b..da3c444 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<ArtifactMetadata> 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<ArtifactMetadata> artifacts = new ArrayList<>();
-        for ( String ns : getRootNamespaces( repoId ) )
+            List<ArtifactMetadata> 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<ArtifactMetadata> artifacts, String repoId, String ns, Date startTime,