Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
private static List<File> findAllFiles(String baseDirectory) {
List<File> files = new LinkedList<File>();
List<File> directories = new LinkedList<File>();
directories.add(new File(baseDirectory));
while (!directories.isEmpty()) {
File [] subFiles = directories.remove(0).listFiles();
for (File f : subFiles) {
if (f.isDirectory()) {
} else {
return files;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.