File dataDirFile = new File( dataDir );
InvService service = new InvService( this.serviceId, this.serviceType.toString(), this.serviceBase, null, null );
DirectoryScanner me = new DirectoryScanner( service, this.serviceTitle, new File( dataDirHeader ), null, true );
assertTrue( me != null );
CrawlableDataset catalogCrDs;
try
{
catalogCrDs = CrawlableDatasetFactory.createCrawlableDataset( dataDirFile.getAbsolutePath(), null, null );
}
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 <" + dataDir + ">." );
InvCatalog catalog = me.getDirCatalog( catalogCrDs, ".*", true, "idBase", false, null, null, null);
// Compare the resulting catalog an the expected catalog resource.