Code example for FileFilter

Methods: accept

0
     * Implement <code>FileFilter.accept(File)</code> by checking  
     * taht input is not null, exists, and is accepted by any delegate. 
     */ 
    public boolean accept(File f) {
        return ((null != f) && (f.exists())
                && ((null == delegate) || delegate.accept(f)));
    } 
 
    //----------------------------- inner subclasses 
    static class FilesOnlyFilter extends ValidFileFilter { 
        public boolean accept(File f) {
            return (super.accept(f) && (!f.isDirectory()));
        } 
    } 
    static class ResourcesOnlyFilter extends FilesOnlyFilter { 
        public boolean accept(File f) {
            return (super.accept(f) && (FileUtil.isResourcePath(f.getPath())));
        } 
    } 
    static class DirsOnlyFilter extends ValidFileFilter { 
        public final boolean accept(File f) {