Java tutorial
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileFilter; import java.util.ArrayList; import java.util.List; public class Main { static List<File> recursiveGetFile(File f, FileFilter ff) { List<File> lf = new ArrayList<File>(); if (f.isFile()) { if (ff.accept(f)) { lf.add(f); } } else { File[] fs = f.listFiles(); for (File tempF : fs) { lf.addAll(recursiveGetFile(tempF, ff)); } } return lf; } }