📅  最后修改于: 2022-03-11 14:52:30.653000             🧑  作者: Mango
try (Stream walkStream = Files.walk(Paths.get("your search directory"))) {
walkStream.filter(p -> p.toFile().isFile()).forEach(f -> {
if (f.toString().endsWith("file to be searched")) {
System.out.println(f + " found!");
}
});
}