Here you can find the source of recursiveListFilesHelper(File dir, FileFilter filter, List
public static void recursiveListFilesHelper(File dir, FileFilter filter, List<File> fileList)
//package com.java2s; //License from project: Apache License import java.io.*; import java.util.List; public class Main { public static void recursiveListFilesHelper(File dir, FileFilter filter, List<File> fileList) { for (File f : dir.listFiles()) { if (f.isDirectory()) { recursiveListFilesHelper(f, filter, fileList); } else { if (filter.accept(f)) fileList.add(f);/*from w ww . j a v a2 s. c om*/ } } } }