MCPcopy Create free account
hub / github.com/0opslab/opslabJutil / listFileAll

Method listFileAll

src/main/java/com/opslab/util/FileUtil.java:564–576  ·  view source on GitHub ↗

罗列指定路径下的全部文件包括文件夹 @param path 需要处理的文件 @return 返回文件列表

(File path)

Source from the content-addressed store, hash-verified

562 * @return 返回文件列表
563 */
564 public final static List<File> listFileAll(File path) {
565 List<File> list = new ArrayList<>();
566 File[] files = path.listFiles();
567 if (CheckUtil.valid(files)) {
568 for (File file : files) {
569 list.add(file);
570 if (file.isDirectory()) {
571 list.addAll(listFileAll(file));
572 }
573 }
574 }
575 return list;
576 }
577
578 /**
579 * 罗列指定路径下的全部文件包括文件夹

Callers 1

deleteDirMethod · 0.95

Calls 2

validMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected