Created
April 1, 2017 13:43
-
-
Save SoltauFintel/2ab1a0efb7e158d30118b235e425df64 to your computer and use it in GitHub Desktop.
List recursive files with Java 8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Files.walkFileTree(Paths.get("../hello-web"), new SimpleFileVisitor<Path>() { | |
@Override | |
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { | |
if (file.toString().endsWith(".java")) { | |
System.out.println(file); | |
} | |
return super.visitFile(file, attrs); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment