org.apache.avalon.cornerstone.blocks.masterstore
Class ExtensionFileFilter
java.lang.Object
org.apache.avalon.cornerstone.blocks.masterstore.ExtensionFileFilter
- All Implemented Interfaces:
- FilenameFilter
- public class ExtensionFileFilter
- extends Object
- implements 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.1.3 $ $Date: 2004/05/16 16:33:18 $
- Author:
- Federico Barbieri , Serge Knystautas , Peter Donald
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExtensionFileFilter
public ExtensionFileFilter(String[] extensions)
ExtensionFileFilter
public ExtensionFileFilter(String extension)
accept
public boolean accept(File file,
String name)
- Specified by:
accept
in interface FilenameFilter
Copyright © Apache Software Foundation. All Rights Reserved.