Tag: subdirs

Java:如何递归获取所有子目录?

在调试延迟时间外的递归函数之前:是否有一个获取子目录的命令? giveMeSubDirs(downToPath) ? // WARNING: RECURSION out of bound or too much data public HashSet getAllDirs(String path) { HashSet checkedDirs = new HashSet(); HashSet allDirs = new HashSet(); String startingPath = path; File fileThing = new File(path); FileObject fileObject = new FileObject(fileThing); for (FileObject dir : getDirsInDir(path)) { // SUBDIR while ( !checkedDirs.contains(dir) && !(getDirsInDir(dir.getFile().getParent()).size() […]