import java.io.*;
import java.util.*;public class MkLst {
private static final String ROOT = "/foo/bar/hoge";
public static void main(String args) {
List flst = new ArrayList();
lsr(new File(ROOT), flst);for (int i = 0; i < flst.size(); i++)
System.out.println(flst.get(i));
}private static void lsr(File file, List flst) {
if (!file.exists())
return;if (file.isDirectory()) {
File children = file.listFiles();for (int i = 0; i < children.length; i++)
lsr(children[i], flst);
} else {
flst.add(file);
}
}}