org.huihoo.jfox.ejb.server
Class FileSuffixFilter

java.lang.Object
  |
  +--org.huihoo.jfox.ejb.server.FileSuffixFilter
All Implemented Interfaces:
java.io.FileFilter

public class FileSuffixFilter
extends java.lang.Object
implements java.io.FileFilter

A suffix based file filter.

Version:
$Revision: 0.1.0 $
Author:
tai_1219@sina.com

Constructor Summary
FileSuffixFilter(java.lang.String suffix)
          Construct a case sensitive FileSuffixFilter.
FileSuffixFilter(java.lang.String[] suffixes)
          Construct a FileSuffixFilter.
FileSuffixFilter(java.lang.String[] suffixes, boolean ignoreCase)
          Construct a FileSuffixFilter.
FileSuffixFilter(java.lang.String suffix, boolean ignoreCase)
          Construct a FileSuffixFilter.
 
Method Summary
 boolean accept(java.io.File file)
          Check if a file is acceptible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSuffixFilter

public FileSuffixFilter(java.lang.String suffix)
Construct a case sensitive FileSuffixFilter.

Parameters:
suffix - The suffix which files must have to be accepted.

FileSuffixFilter

public FileSuffixFilter(java.lang.String suffix,
                        boolean ignoreCase)
Construct a FileSuffixFilter.

Parameters:
suffix - The suffix which files must have to be accepted.
ignoreCase - True if the filter should be case-insensitive.

FileSuffixFilter

public FileSuffixFilter(java.lang.String[] suffixes)
Construct a FileSuffixFilter.

Parameters:
suffixes - A list of suffixes which files mut have to be accepted.@param suffixes[]

FileSuffixFilter

public FileSuffixFilter(java.lang.String[] suffixes,
                        boolean ignoreCase)
Construct a FileSuffixFilter.

Parameters:
suffixes - A list of suffixes which files mut have to be accepted.
ignoreCase - True if the filter should be case-insensitive.@param suffixes[]
Method Detail

accept

public boolean accept(java.io.File file)
Check if a file is acceptible.

Specified by:
accept in interface java.io.FileFilter
Parameters:
file - The file to check.
Returns:
true if the file is acceptable.