Java tutorial
//package com.java2s; import java.io.File; import java.io.FileFilter; public class Main { private static File[] listFiles(File dir) { File[] fileList = dir.listFiles(new FileFilter() { public boolean accept(File file) { return file.isFile(); } }); return fileList; } }