Here you can find the source of getFiles(File dir, final String extensionFilter)
public static File[] getFiles(File dir, final String extensionFilter)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FilenameFilter; public class Main { public static File[] getFiles(File dir, final String extensionFilter) { return dir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.toLowerCase().endsWith("." + extensionFilter); }//from w w w . ja va 2 s. c om }); } }