return( this.getDirCatalog( directory, filterPattern, sortInIncreasingOrder, null, addDatasetSize, null, null, null) );
}
public InvCatalog getDirCatalog( File directory, String filterPattern, boolean sortInIncreasingOrder, String addIdBase, boolean addDatasetSize, String dsNameMatchPattern, String startTimeSubstitutionPattern, String duration )
{
CrawlableDataset catalogCrDs;
try
{
catalogCrDs = CrawlableDatasetFactory.createCrawlableDataset( directory.getAbsolutePath(), null, null );
}
catch ( IOException e )
{
// @todo Should throw an IOException!
throw new IllegalArgumentException( "IOException while creating dataset: " + e.getMessage() );
}
catch ( ClassNotFoundException e )
{
throw new IllegalArgumentException( "Did not find class: " + e.getMessage() );
}
catch ( NoSuchMethodException e )
{
throw new IllegalArgumentException( "Required constructor not found in class: " + e.getMessage() );
}
catch ( IllegalAccessException e )
{
throw new IllegalArgumentException( "Did not have necessary access to class: " + e.getMessage() );
}
catch ( InvocationTargetException e )
{
throw new IllegalArgumentException( "Could not invoke required method in class: " + e.getMessage() );
}
catch ( InstantiationException e )
{
throw new IllegalArgumentException( "Could not instatiate class: " + e.getMessage() );
}
if ( ! catalogCrDs.isCollection() )
throw new IllegalArgumentException( "catalog directory is not a directory <" + serviceBaseUrlDir.getAbsolutePath() + ">." );
return getDirCatalog( catalogCrDs, filterPattern, sortInIncreasingOrder, addIdBase, addDatasetSize, dsNameMatchPattern, startTimeSubstitutionPattern, duration );
}