static public MCollection factory ( FeatureCollectionConfig config , Path topDir , boolean isTop , IndexReader indexReader , String suffix , org . slf4j . Logger logger ) throws IOException { DirectoryBuilder builder = new DirectoryBuilder ( config . collectionName , topDir . toString ( ) , suffix ) ; DirectoryPartition dpart = new DirectoryPartition ( config , topDir , isTop , indexReader , suffix , logger ) ; if ( ! builder . isLeaf ( indexReader ) ) { // its a partition return dpart ; } // its a collection boolean hasIndex = builder . findIndex ( ) ; if ( hasIndex ) { return dpart . makeChildCollection ( builder ) ; } else { DirectoryCollection result = new DirectoryCollection ( config . collectionName , topDir , isTop , config . olderThan , logger ) ; // no index file return result ; } }
returns a DirectoryPartition or DirectoryCollection