org.apache.avalon.excalibur.io
Class PrefixFileFilter

java.lang.Object
  |
  +--org.apache.avalon.excalibur.io.PrefixFileFilter
All Implemented Interfaces:
FilenameFilter

public class PrefixFileFilter
extends Object
implements FilenameFilter

This filters filenames for a certain prefix.

Eg., to print all files and directories in the current directory whose name starts with

foo:
 File dir = new File(".");
 String[] files = dir.list( new PrefixFileFilter("foo"));
 for ( int i=0; i<files.length; i++ )
 {
     System.out.println(files[i]);
 }
 

Since:
4.0
Version:
CVS $Revision: 1.4 $ $Date: 2003/03/22 12:46:24 $
Author:
Federico Barbieri , Serge Knystautas , Peter Donald

Constructor Summary
PrefixFileFilter(String prefix)
           
PrefixFileFilter(String[] prefixs)
           
 
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

PrefixFileFilter

public PrefixFileFilter(String[] prefixs)

PrefixFileFilter

public PrefixFileFilter(String prefix)
Method Detail

accept

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


Copyright © 2000-2003 Apache Jakarta Project. All Rights Reserved.