FileDocCategorySizeDatePackage
AbstractFileFilter.javaAPI DocAndroid 1.5 API2364Wed May 06 22:42:46 BST 2009org.apache.commons.io.filefilter

AbstractFileFilter

public abstract class AbstractFileFilter extends Object implements IOFileFilter
An abstract class which implements the Java FileFilter and FilenameFilter interfaces via the IOFileFilter interface.

Note that a subclass must override one of the accept methods, otherwise your class will infinitely loop.

since
Commons IO 1.0
version
$Revision: 539231 $ $Date: 2007-05-18 04:10:33 +0100 (Fri, 18 May 2007) $
author
Stephen Colebourne

Fields Summary
Constructors Summary
Methods Summary
public booleanaccept(java.io.File file)
Checks to see if the File should be accepted by this filter.

param
file the File to check
return
true if this file matches the test

        return accept(file.getParentFile(), file.getName());
    
public booleanaccept(java.io.File dir, java.lang.String name)
Checks to see if the File should be accepted by this filter.

param
dir the directory File to check
param
name the filename within the directory to check
return
true if this file matches the test

        return accept(new File(dir, name));
    
public java.lang.StringtoString()
Provide a String representaion of this file filter.

return
a String representaion

        String name = getClass().getName();
        int period = name.lastIndexOf('.");
        return (period > 0 ? name.substring(period + 1) : name);