public int crawl ( InvCatalogImpl cat , CancelTask task , PrintWriter out , Object context ) { if ( out != null ) out . println ( "***CATALOG " + cat . getCreateFrom ( ) ) ; countCatrefs = 0 ; for ( InvDataset ds : cat . getDatasets ( ) ) { if ( type == Type . all ) crawlDataset ( ds , task , out , context , true ) ; else crawlDirectDatasets ( ds , task , out , context , true ) ; if ( ( task != null ) && task . isCancel ( ) ) break ; } return 1 + countCatrefs ; }
Crawl a catalog thats already been opened . When you get to a dataset containing leaf datasets do all only the first or a randomly chosen one .