Here you can find the source of getFiles(String path, final String suffix)
public static ArrayList<File> getFiles(String path, final String suffix)
//package com.java2s; //License from project: Open Source License import java.io.*; import java.util.ArrayList; public class Main { public static ArrayList<File> getFiles(String path, final String suffix) { ArrayList<File> flist = new ArrayList<File>(); File[] files = (new File(path)).listFiles(); for (File file : files) { if (file.isDirectory()) flist.addAll(getFiles(file.getAbsolutePath(), suffix)); else if (file.getName().endsWith(suffix)) flist.add(file);/* w w w .j a v a 2 s. co m*/ } return flist; } }