public InvDataset expand ( ) throws IOException { // Get the new catalog being generated and its top-level dataset. this . resultingCatalog = this . createSkeletonCatalog ( prefixUrlPath ) ; this . accessPointDataset = ( InvDataset ) this . resultingCatalog . getDatasets ( ) . get ( 0 ) ; // IOException thrown by createSkeletonCatalog() so this check should not be necessary. if ( ! this . isCollection ( this . accessPointDataset ) ) { String tmpMsg = "The access point dataset <" + this . accessPointDataset . getName ( ) + "> must be a collection dataset." ; logger . warn ( "expand(): {}" , tmpMsg ) ; throw new IOException ( tmpMsg ) ; } // Recurse into directory structure and expand. expandRecursive ( this . accessPointDataset ) ; // Finish the catalog. ( ( InvCatalogImpl ) this . resultingCatalog ) . finish ( ) ; // Remove empty collection datasets. @todo HACK - should use filters instead. this . recursivelyRemoveEmptyCollectionDatasets ( this . accessPointDataset ) ; // Return the top-level dataset. return ( this . accessPointDataset ) ; }
Crawl this DatasetSource and generate a new InvCatalog return the top - level InvDataset .