Answers for "java file search recursive"

0

java file search recursive

try (Stream<Path> 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!");
        }
    });
}
Posted by: Guest on April-12-2021

Code answers related to "java file search recursive"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language