org.omegahat.Environment.IO
Class ExtensionFilenameFilter

java.lang.Object
  |
  +--org.omegahat.Environment.IO.ExtensionFilenameFilter
All Implemented Interfaces:
java.io.FilenameFilter, java.io.Serializable
Direct Known Subclasses:
ClassFileFilter

public class ExtensionFilenameFilter
extends java.lang.Object
implements java.io.FilenameFilter, java.io.Serializable

A filter used to identify files based on their extension. This is used when processing lists of files, typically from directories or archives.

See Also:
org.omegahat.Environment.Tools.ClassLists.ClassList, FileLocator, Serialized Form

Field Summary
protected  java.lang.String extension
          The extension used to detect a match.
 
Constructor Summary
ExtensionFilenameFilter(java.lang.String ext)
           
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          Method used to determine if a particular file within the specified directory matches, performed simply matching the end of the file name with the extension of interest.
 java.lang.String extension()
          Retrieve the extension string of interest.
 java.lang.String extension(java.lang.String ext)
          Set the extension of interest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extension

protected java.lang.String extension
The extension used to detect a match.
Constructor Detail

ExtensionFilenameFilter

public ExtensionFilenameFilter(java.lang.String ext)
Method Detail

extension

public java.lang.String extension()
Retrieve the extension string of interest.

extension

public java.lang.String extension(java.lang.String ext)
Set the extension of interest.

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Method used to determine if a particular file within the specified directory matches, performed simply matching the end of the file name with the extension of interest.
Specified by:
accept in interface java.io.FilenameFilter