Here you can find the source of listFiles(File rootDir, final String... sufix)
public static File[] listFiles(File rootDir, final String... sufix)
//package com.java2s; import java.io.File; import java.io.FilenameFilter; public class Main { public static File[] listFiles(File rootDir, final String... sufix) { return rootDir.listFiles(new FilenameFilter() { @Override/*from w ww . j a v a 2 s . c o m*/ public boolean accept(File dir, String name) { for (String s : sufix) { if (name.toLowerCase().endsWith(s.toLowerCase())) { return true; } } return false; } }); } }