org.apache.avalon.cornerstone.blocks.masterstore
Class ExtensionFileFilter
java.lang.Object
org.apache.avalon.cornerstone.blocks.masterstore.ExtensionFileFilter
- All Implemented Interfaces:
- java.io.FilenameFilter
- public class ExtensionFileFilter
- extends java.lang.Object
- implements java.io.FilenameFilter
This filters files based on the extension (what the filename
ends with). This is used in retrieving all the files of a
particular type.
Eg., to retrieve and print all *.java
files in the current directory:
File dir = new File(".");
String[] files = dir.list( new ExtensionFileFilter( new String[]{"java"} ) );
for (int i=0; i<files.length; i++)
{
System.out.println(files[i]);
}
- Since:
- 4.0
- Version:
- CVS $Revision: 1.1 $ $Date: 2004/03/15 15:42:05 $
- 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 |
ExtensionFileFilter
public ExtensionFileFilter(java.lang.String[] extensions)
ExtensionFileFilter
public ExtensionFileFilter(java.lang.String extension)
accept
public boolean accept(java.io.File file,
java.lang.String name)
- Specified by:
accept
in interface java.io.FilenameFilter
Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.