Here you can find the source of getFilenameFilter(final String extension)
public static FilenameFilter getFilenameFilter(final String extension)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FilenameFilter; public class Main { public static FilenameFilter getFilenameFilter(final String extension) { return new FilenameFilter() { @Override//from w w w .j a v a 2s . c om public boolean accept(File file, String name) { return file.isFile() && name.endsWith(extension); } }; } }