Skip to content

Instantly share code, notes, and snippets.

@Serphentas
Created August 25, 2016 17:32
Show Gist options
  • Save Serphentas/658babaa1737628f9f80ba1630bb855f to your computer and use it in GitHub Desktop.
Save Serphentas/658babaa1737628f9f80ba1630bb855f to your computer and use it in GitHub Desktop.
[Java] Recursive file listing
private static void print(File input) {
System.out.println(input.getPath() + "/");
for (File f : input.listFiles(File::isDirectory)) {
print(f);
}
for (File f : input.listFiles(File::isFile)) {
System.out.println(f.getPath());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment