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,