com.mindprod.filter
Class StartsWithFilter

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

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

Filters files whose names start with a given string, case insensitive.

Does not accept directories. See DirListFilter. see also FileListFilter and ClamFilter.

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

Constructor Summary
StartsWithFilter(java.lang.String startsWith)
          constructor.
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          Select only Files starting 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

StartsWithFilter

public StartsWithFilter(java.lang.String startsWith)
constructor.

Parameters:
startsWith - string file must start with. Case Insensitive.
Method Detail

accept

public final boolean accept(java.io.File dir,
                            java.lang.String name)
Select only Files starting 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.