FileDocCategorySizeDatePackage
AndFileFilter.javaAPI DocApache James 2.3.12465Fri Jan 12 12:56:34 GMT 2007org.apache.james.util.io

AndFileFilter

public class AndFileFilter extends Object implements FilenameFilter
Accepts a selection if it is acceptable to both of two {@link FilenameFilter}s. This takes two {@link FilenameFilter}s as input.

Eg., to print all files beginning with A and ending with .java:

File dir = new File(".");
String[] files = dir.list( new AndFileFilter(
new PrefixFileFilter("A"),
new ExtensionFileFilter(".java")
)
);
for ( int i=0; i<files.length; i++ )
{
System.out.println(files[i]);
}
author
Avalon Development Team
version
$Revision: 494012 $ $Date: 2007-01-08 11:23:58 +0100 (Mo, 08 Jan 2007) $
since
4.0

Fields Summary
private final FilenameFilter
m_filter1
private final FilenameFilter
m_filter2
Constructors Summary
public AndFileFilter(FilenameFilter filter1, FilenameFilter filter2)

        m_filter1 = filter1;
        m_filter2 = filter2;
    
Methods Summary
public booleanaccept(java.io.File file, java.lang.String name)

        return m_filter1.accept( file, name ) && m_filter2.accept( file, name );