/** * Returns <code>true</code> if the specified file matches the requirements of this filter, and <code>false</code> * otherwise. * * @param dir the file or directory. * @return A boolean. */ public boolean accept( final File dir ) { if ( dir.isDirectory() && acceptsDirectories() ) { return true; } for ( int i = 0; i < fileext.length; i++ ) { if ( dir.getName().endsWith( this.fileext[ i ] ) ) { return true; } } return false; }
/** * Returns <code>true</code> if the file is accepted, and <code>false</code> otherwise. * * @param dir the directory. * @param name the file name. * @return A boolean. */ public boolean accept( final File dir, final String name ) { final File f = new File( dir, name ); if ( f.isDirectory() && acceptsDirectories() ) { return true; } for ( int i = 0; i < fileext.length; i++ ) { if ( name.endsWith( this.fileext[ i ] ) ) { return true; } } return false; }
/** * Returns <code>true</code> if the specified file matches the requirements of this * filter, and <code>false</code> otherwise. * * @param dir the file or directory. * @return A boolean. */ public boolean accept(final File dir) { if (dir.isDirectory() && acceptsDirectories()) { return true; } for (int i = 0; i < fileext.length; i++) { if (dir.getName().endsWith(this.fileext[i])) { return true; } } return false; }
/** * Returns <code>true</code> if the file is accepted, and <code>false</code> otherwise. * * @param dir the directory. * @param name the file name. * @return A boolean. */ public boolean accept(final File dir, final String name) { final File f = new File(dir, name); if (f.isDirectory() && acceptsDirectories()) { return true; } for (int i = 0; i < fileext.length; i++) { if (name.endsWith(this.fileext[i])) { return true; } } return false; }