Class FileExtensionFilter

java.lang.Object
  extended byFileExtensionFilter
All Implemented Interfaces:
java.io.FilenameFilter

public class FileExtensionFilter
extends java.lang.Object
implements java.io.FilenameFilter

File extension filter - tests if a specified file should be included in a file list. Author: Ageenko Created: Mar 17, 2003 Version: 1


Constructor Summary
FileExtensionFilter(java.lang.String end)
          Constructor for the filter.
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          Filter accepts only files that have particular extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileExtensionFilter

public FileExtensionFilter(java.lang.String end)
Constructor for the filter.

Parameters:
end - a file ending (e.g. extension)
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Filter accepts only files that have particular extension. Filter used in File.listFiles(...) method.

Specified by:
accept in interface java.io.FilenameFilter
Parameters:
dir - file path
name - file name
Returns:
true if the file name ends with extension