org.apache.james.util.io
Class AndFileFilter

java.lang.Object
  extended byorg.apache.james.util.io.AndFileFilter
All Implemented Interfaces:
FilenameFilter

public class AndFileFilter
extends Object
implements FilenameFilter

Accepts a selection if it is acceptable to both of two FilenameFilters. This takes two FilenameFilters 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]);
 }
 

Since:
4.0
Version:
$Revision: 365582 $ $Date: 2006-01-03 03:51:21 -0500 (Tue, 03 Jan 2006) $
Author:
Avalon Development Team

Constructor Summary
AndFileFilter(FilenameFilter filter1, FilenameFilter filter2)
           
 
Method Summary
 boolean accept(File file, String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndFileFilter

public AndFileFilter(FilenameFilter filter1,
                     FilenameFilter filter2)
Method Detail

accept

public boolean accept(File file,
                      String name)
Specified by:
accept in interface FilenameFilter


"Copyright © 1999-2006 Apache Jakarta Project. All Rights Reserved."