wt.tools.path
Class Search
java.lang.Object
wt.tools.path.Search
- public class Search
- extends Object
Search provides that a means of executing a search through a path
(list of directories), looking for files that match a specified
pattern.
For each file found, a method can be executed. The method is defined
by implemented FileFunction and implementing the required methods.
FileDescriptionPrint provides the default method execution for each file.
It prints a file description to the standard output stream.
Example:
Search search = new Search( new FileDescriptionPrint() );
// This execute will list all files named My.class,
// that are found under c:\myclasses.
search.execute( "c:\myclasses", "My*.class" )
- See Also:
FileFunction
,
FileDescriptionPrint
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PATTERN
protected static final int PATTERN
- See Also:
- Constant Field Values
PATTERN_BEGIN
protected static final int PATTERN_BEGIN
- See Also:
- Constant Field Values
PATTERN_END
protected static final int PATTERN_END
- See Also:
- Constant Field Values
patternPieces
protected String[][] patternPieces
currentEntry
protected String currentEntry
recurse
protected boolean recurse
fileFunction
protected FileFunction fileFunction
Search
public Search(FileFunction theFileFunction)
execute
public void execute(String path,
String thePatterns)
isPatternMatch
protected boolean isPatternMatch(String fileEntry)
main
public static void main(String[] args)
processDirectory
protected void processDirectory(File directory)
processPathEntry
protected void processPathEntry(File entry)
processZipFile
protected void processZipFile(File file)
setRecurse
public void setRecurse(boolean recurse)