wyvern.common.util
Class ExtensionFilter

java.lang.Object
  extended bywyvern.common.util.ExtensionFilter
All Implemented Interfaces:
java.io.FilenameFilter

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

A customizable FilenameFilter subclass. Pass the extension of the files you want to accept.

Version:
1.0, June 29, 1997
Author:
Steve Yegge

Field Summary
protected  java.lang.String[] ext_
           
protected  boolean ignoreCase_
           
protected  boolean includeDirs_
           
 
Constructor Summary
ExtensionFilter(java.lang.String extension)
          Creates a new ExtensionFilter that accepts files with the specified extension.
ExtensionFilter(java.lang.String[] extensions)
          Constructs a new ExtensionFilter that accepts multiple extensions.
ExtensionFilter(java.lang.String[] extensions, boolean dirs)
          Constructs a new ExtensionFilter that accepts multiple extensions, and optionally directories.
ExtensionFilter(java.lang.String[] ext, boolean dirs, boolean ignoreCase)
          Constructs a new ExtensionFilter with the given extensions, optionally including directories, optionally performing a case-sensitive match.
ExtensionFilter(java.lang.String extension, boolean dirs)
          Creates a new ExtensionFilter that accepts files with the specified extension.
ExtensionFilter(java.lang.String extension, boolean dirs, boolean ignoreCase)
          Constructs a new ExtensionFilter with the given extensions, optionally including directories, optionally performing a case-sensitive match.
 
Method Summary
 boolean accept(java.io.File file, java.lang.String name)
          Implementation for FilenameFilter methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ext_

protected java.lang.String[] ext_

includeDirs_

protected boolean includeDirs_

ignoreCase_

protected boolean ignoreCase_
Constructor Detail

ExtensionFilter

public ExtensionFilter(java.lang.String extension)
Creates a new ExtensionFilter that accepts files with the specified extension.

Parameters:
extension - the filename extension we want to accept, such as ".gif".

ExtensionFilter

public ExtensionFilter(java.lang.String[] extensions)
Constructs a new ExtensionFilter that accepts multiple extensions.


ExtensionFilter

public ExtensionFilter(java.lang.String[] extensions,
                       boolean dirs)
Constructs a new ExtensionFilter that accepts multiple extensions, and optionally directories.


ExtensionFilter

public ExtensionFilter(java.lang.String extension,
                       boolean dirs)
Creates a new ExtensionFilter that accepts files with the specified extension.

Parameters:
extension - the filename extension we want to accept
dirs - whether to accept directories as well

ExtensionFilter

public ExtensionFilter(java.lang.String[] ext,
                       boolean dirs,
                       boolean ignoreCase)
Constructs a new ExtensionFilter with the given extensions, optionally including directories, optionally performing a case-sensitive match.


ExtensionFilter

public ExtensionFilter(java.lang.String extension,
                       boolean dirs,
                       boolean ignoreCase)
Constructs a new ExtensionFilter with the given extensions, optionally including directories, optionally performing a case-sensitive match.

Method Detail

accept

public boolean accept(java.io.File file,
                      java.lang.String name)
Implementation for FilenameFilter methods.

Specified by:
accept in interface java.io.FilenameFilter