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]);
}
|