Code example for FilenameFilter

Methods: accept

0
     * @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);
        } else { 
            return super.accept(dir, name);
        } 
    } 
 
    /** 
     * Provide a String representaion of this file filter. 
     * 
     * @return a String representaion 
     */ 
    public String toString() {
        String delegate = (fileFilter != null ? fileFilter.toString() : filenameFilter.toString()); 
        return super.toString() + "(" + delegate + ")";
    }