Here you can find the source of getAllFiles(File input)
public static List<File> getAllFiles(File input)
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.ArrayList; import java.util.List; public class Main { public static List<File> getAllFiles(File input) { ArrayList<File> a = new ArrayList<>(); if (!input.isDirectory()) { a.add(input);/* ww w . j a v a 2 s . c om*/ return a; } for (File f : input.listFiles()) { a.addAll(getAllFiles(f)); } return a; } }