Code example for FileFilter

Methods: accept

0
     * @param file  the file to check 
     * @return true if the filter matches 
     */ 
    public boolean accept(File file) {
        if (fileFilter != null) {
            return fileFilter.accept(file);
        } else { 
            return super.accept(file);
        } 
    } 
 
    /** 
     * Checks the filter. 
     *  
     * @param dir  the directory 
     * @param name  the filename in the directory 
     * @return true if the filter matches 
     */ 
    public boolean accept(File dir, String name) {
        if (filenameFilter != null) {
            return filenameFilter.accept(dir, name);