org.apache.avalon.excalibur.io
Class PrefixFileFilter
java.lang.Object
|
+--org.apache.avalon.excalibur.io.PrefixFileFilter
- All Implemented Interfaces:
- java.io.FilenameFilter
- public class PrefixFileFilter
- extends java.lang.Object
- implements java.io.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.5 $ $Date: 2001/12/11 09:53:29 $
- Author:
- Federico Barbieri , Serge Knystautas , Peter Donald
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 |
PrefixFileFilter
public PrefixFileFilter(java.lang.String[] prefixs)
PrefixFileFilter
public PrefixFileFilter(java.lang.String prefix)
accept
public boolean accept(java.io.File file,
java.lang.String name)
- Specified by:
accept
in interface java.io.FilenameFilter
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.