com.generationjava.io.find
Class FileFinder

java.lang.Object
  |
  +--com.generationjava.io.find.FileFinder
All Implemented Interfaces:
Finder

public class FileFinder
extends java.lang.Object
implements Finder

Finds Files in a file system. Informs FindListeners whenever a Find is made, and returns the finds to the user.


Constructor Summary
FileFinder()
           
 
Method Summary
 void addFindListener(com.generationjava.io.find.FindListener fl)
          Add a FindListener.
 java.lang.String[] find(java.io.File directory)
          Find all files in the specified directory.
 java.lang.String[] find(java.io.File directory, java.lang.String extension)
          Find all files in the specified directory with the specified extension.
 boolean getIncludeDirectories()
          Will it find directories, as well as files.
 void notifyDirectoryFinished(java.io.File directory, java.lang.String[] files)
          Notify all FindListeners that a directory has been finished.
 void notifyDirectoryStarted(java.io.File directory)
          Notify all FindListeners that a directory is being started.
 void notifyFileFound(java.io.File directory, java.lang.String file)
          Notify FindListeners that a file has been found.
 void setIncludeDirectories(boolean bool)
          Find directories, as well as files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFinder

public FileFinder()
Method Detail

setIncludeDirectories

public void setIncludeDirectories(boolean bool)
Find directories, as well as files.


getIncludeDirectories

public boolean getIncludeDirectories()
Will it find directories, as well as files.


find

public java.lang.String[] find(java.io.File directory)
Find all files in the specified directory.

Specified by:
find in interface Finder

find

public java.lang.String[] find(java.io.File directory,
                               java.lang.String extension)
Find all files in the specified directory with the specified extension.

Specified by:
find in interface Finder

addFindListener

public void addFindListener(com.generationjava.io.find.FindListener fl)
Add a FindListener.

Specified by:
addFindListener in interface Finder

notifyDirectoryStarted

public void notifyDirectoryStarted(java.io.File directory)
Notify all FindListeners that a directory is being started.


notifyDirectoryFinished

public void notifyDirectoryFinished(java.io.File directory,
                                    java.lang.String[] files)
Notify all FindListeners that a directory has been finished. Supplying the filenames that have been found.


notifyFileFound

public void notifyFileFound(java.io.File directory,
                            java.lang.String file)
Notify FindListeners that a file has been found.



Copyright © 2000-2003 OSJava. All Rights Reserved.