A nice usage of java.io.FileFilter, as seen onin https://stackoverflow.com/a/286001/146745Java - get the newest file in a directory?:
File fl = new File(dir); File[] files = fl.listFiles(new FileFilter() { public boolean accept(File file) { return file.isFile(); } });