Here you can find the source of recursiveList(File dir, FilenameFilter filter)
public static File[] recursiveList(File dir, FilenameFilter filter)
//package com.java2s; /*//from ww w . jav a 2s . c o m * Copyright 2002 Felix Pahl. All rights reserved. * Use is subject to license terms. */ import java.io.File; import java.io.FilenameFilter; import java.util.Vector; public class Main { public static File[] recursiveList(File dir, FilenameFilter filter) { Vector v = new Vector(); addRecursiveList(dir, filter, v); File[] files = new File[v.size()]; v.copyInto(files); return files; } public static void addRecursiveList(File dir, FilenameFilter filter, Vector v) { if (dir.isDirectory()) { String[] list = dir.list(filter); for (int i = 0; i < list.length; i++) addRecursiveList(new File(dir, list[i]), filter, v); } else v.add(dir); } }