Here you can find the source of getAllFilesIn(File dir, final String type)
public static final List<File> getAllFilesIn(File dir, final String type)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FilenameFilter; import java.util.Arrays; import java.util.List; public class Main { public static final List<File> getAllFilesIn(File dir, final String type) { return Arrays.asList(dir.listFiles(new FilenameFilter() { @Override/*from w w w. ja v a 2 s.com*/ public boolean accept(File arg0, String arg1) { return arg1.endsWith(type); } })); } }