tribble.net.ftp.shell
Class ForeachFilter

java.lang.Object
  extended by tribble.net.ftp.shell.ForeachFilter
All Implemented Interfaces:
java.io.FilenameFilter

 class ForeachFilter
extends java.lang.Object
implements java.io.FilenameFilter

FTP command interpreter 'foreach' filename filter.

Since:
2007-04-13
Version:
$Revision: 1.3 $ $Date: 2007/05/16 23:08:53 $
Author:
David R. Tribble (david@tribble.com).

Copyright ©2007 by David R. Tribble, all rights reserved.
Permission is granted to any person or entity except those designated by by the United States Department of State as a terrorist, or terrorist government or agency, to use and distribute this source code provided that the original copyright notice remains present and unaltered.

See Also:
Interp

Field Summary
(package private) static java.lang.String REV
          Revision information.
 
Constructor Summary
ForeachFilter(java.lang.String[] patterns)
          Constructor.
ForeachFilter(java.lang.String[] patterns, boolean ignoreCase)
          Constructor.
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String fname)
          Determine if a filename matches one of the given patterns.
(package private)  void setMax(int max)
          Set the maximum number of filename matches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REV

static final java.lang.String REV
Revision information.

See Also:
Constant Field Values
Constructor Detail

ForeachFilter

ForeachFilter(java.lang.String[] patterns)
Constructor. Filename matching is case-sensitive or insensitive, as appropriate for the native operating system.

Parameters:
patterns - Filename patterns to match.
Since:
1.1, 2007-04-13

ForeachFilter

ForeachFilter(java.lang.String[] patterns,
              boolean ignoreCase)
Constructor.

Parameters:
patterns - Filename patterns to match.
ignoreCase - If true, filename matching is not case-sensitive (i.e., alphabetic case is ignored), otherwise it is (case is not ignored).
Since:
1.3, 2007-05-14
Method Detail

setMax

void setMax(int max)
Set the maximum number of filename matches.

Parameters:
max - Maximum number of filenames to match. Zero (0) indicates that there is no maximum.
Since:
1.3, 2007-05-14

accept

public boolean accept(java.io.File dir,
                      java.lang.String fname)
Determine if a filename matches one of the given patterns.

Specified by:
accept in interface java.io.FilenameFilter
Since:
1.1, 2007-04-13