Here you can find the source of getFilesForType(final File target, final String extension)
public static File[] getFilesForType(final File target, final String extension)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileFilter; public class Main { public static File[] getFilesForType(final File target, final String extension) { File[] files = target.listFiles(new FileFilter() { public boolean accept(File pathname) { if (pathname.getName().indexOf(extension) != -1) { return true; }//from ww w . ja v a 2 s.com return false; } }); return files; } }