Here you can find the source of getFilesOnlyFilter()
public static FileFilter getFilesOnlyFilter()
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.io.File; import java.io.FileFilter; public class Main { private static final FileFilter filesOnlyFilter = new FileFilter() { public boolean accept(File pathname) { return pathname.isFile(); }/* ww w . ja v a2 s. c om*/ }; /** * @return a {@link FileFilter} implementation that returns only files. */ public static FileFilter getFilesOnlyFilter() { return filesOnlyFilter; } }