com.mindprod.filter
Class EndsWithFilter

java.lang.Object
  extended by com.mindprod.filter.EndsWithFilter
All Implemented Interfaces:
java.io.FilenameFilter

public final class EndsWithFilter
extends java.lang.Object
implements java.io.FilenameFilter

Select files that end with a particular string.

Filters files whose file names end with a given string, case insensitive. Does not accept directories. See DirListFilter. see also FileListFilter and ClamFilter.

Since:
2003
Version:
2.7 2010-11-22 - add optional invert parameter on a number of the filters..
Author:
Roedy Green, Canadian Mind Products

Constructor Summary
EndsWithFilter(boolean invert, java.lang.String endsWith)
          constructor
EndsWithFilter(java.lang.String endsWith)
          constructor
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          Select only Files ending with our string.
static void main(java.lang.String[] args)
          TEST harness.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndsWithFilter

public EndsWithFilter(java.lang.String endsWith)
constructor

Parameters:
endsWith - string file must end with. Case Insensitive.

EndsWithFilter

public EndsWithFilter(boolean invert,
                      java.lang.String endsWith)
constructor

Parameters:
invert - if true, selects files not in the list instead.
endsWith - string file must end with. Case Insensitive.
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Select only Files ending with our string.

Specified by:
accept in interface java.io.FilenameFilter
Parameters:
dir - the directory in which the file was found.
name - the name of the file.
Returns:
true if and only if the name should be included in the file list; false otherwise.

main

public static void main(java.lang.String[] args)
TEST harness.

Parameters:
args - not used.