Created
August 25, 2016 17:32
-
-
Save Serphentas/658babaa1737628f9f80ba1630bb855f to your computer and use it in GitHub Desktop.
[Java] Recursive file listing
This file contains hidden or 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
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