org.apache.james.util.io
Class AndFileFilter

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

public class AndFileFilter
extends java.lang.Object
implements java.io.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: 494012 $ $Date: 2007-01-08 10:23:58 +0000 (lun, 08 gen 2007) $
Author:
Avalon Development Team

Constructor Summary
AndFileFilter(java.io.FilenameFilter filter1, java.io.FilenameFilter filter2)
           
 
Method Summary
 boolean accept(java.io.File file, java.lang.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(java.io.FilenameFilter filter1,
                     java.io.FilenameFilter filter2)
Method Detail

accept

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


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.