edu.stanford.nlp.io
Class ExtensionFileFilter

java.lang.Object
  |
  +--edu.stanford.nlp.io.ExtensionFileFilter
All Implemented Interfaces:
FileFilter

public class ExtensionFileFilter
extends Object
implements FileFilter

Implements a file filter that uses file extensions to filter files.


Constructor Summary
ExtensionFileFilter(String ext, boolean recurse)
          Sets up Extension file filter by specifying an extension to accept (currently only 1) and whether to also display folders for recursive search.
 
Method Summary
 boolean accept(File file)
          Checks whether a file satisfies the selection filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionFileFilter

public ExtensionFileFilter(String ext,
                           boolean recurse)
Sets up Extension file filter by specifying an extension to accept (currently only 1) and whether to also display folders for recursive search. The passed extension may be null, in which case the filter will pass all files (passing an empty String does not have the same effect -- this would look for file names ending in a period)

Parameters:
ext - File extension (not including period) or null for any
recurse - go into folders
Method Detail

accept

public boolean accept(File file)
Checks whether a file satisfies the selection filter.

Specified by:
accept in interface FileFilter
Parameters:
file - The file
Returns:
true if the file is acceptable


Stanford NLP Group