private List < PackageDir > findPackageDirs ( List < File > dirs , List < File > excludes ) throws IOException , DataAccessException { List < PackageDir > pkgSubDirs = new ArrayList <> ( ) ; List < File > allSubDirs = new ArrayList <> ( ) ; for ( File dir : dirs ) { MdwIgnore mdwIgnore = new MdwIgnore ( dir ) ; for ( File sub : dir . listFiles ( ) ) { if ( sub . isDirectory ( ) && ! sub . equals ( getArchiveDir ( ) ) && ! excludes . contains ( sub ) && ! mdwIgnore . isIgnore ( sub ) ) { if ( new File ( sub + "/.mdw" ) . isDirectory ( ) ) { PackageDir pkgSubDir = new PackageDir ( getAssetRoot ( ) , sub , getAssetVersionControl ( ) ) ; if ( pkgSubDir . parse ( ) ) pkgSubDirs . add ( pkgSubDir ) ; } allSubDirs . add ( sub ) ; } } } if ( ! allSubDirs . isEmpty ( ) ) pkgSubDirs . addAll ( findPackageDirs ( allSubDirs , excludes ) ) ; return pkgSubDirs ; }
Finds the next level of sibling PackageDirs under a set of non - package dirs .