question: public static List < String > findChildrensList ( final File dir , final boolean searchDirs ) { List < String > files = new ArrayList < > ( ) ; for ( String subFiles : dir . list ( ) ) { File file = new File ( dir + "/" + subFiles ) ; if ( ( searchDirs && file . isDirectory ( ) ) || ( ! searchDirs && ! file . isDirectory ( ) ) ) { files . add ( file . getName ( ) ) ; } } return files ; }
target:  Gets list of childeren folder or files for dir, according to searchDirs param.