rj.tools.util
Class FileFinder

java.lang.Object
  extended byrj.tools.util.FileFinder

public class FileFinder
extends java.lang.Object

FileFinder is helper clas which assists in getting all files from a folder. A filter can be used to match certain patterns. Also a recuresive descent to getValue files from subfolder is supported.

If a FileFilter is used, it has to return true if the File is a directory and the recursive option is used.

Version:
__0.98.1__
Author:
Ralph Jocham

Constructor Summary
FileFinder(java.lang.String folder, boolean recursive)
          Constructor
FileFinder(java.lang.String folder, java.io.FileFilter filter, boolean recursive)
          Constructor
 
Method Summary
 java.util.Collection getDirectories()
          getDirectories returns a collection of directories found in the directorie(s) being searched.
 java.util.Collection getFiles()
          getFiles return the collection of files found
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFinder

public FileFinder(java.lang.String folder,
                  boolean recursive)
Constructor

Parameters:
folder - - folder to list
recursive - - descend into subfolders

FileFinder

public FileFinder(java.lang.String folder,
                  java.io.FileFilter filter,
                  boolean recursive)
Constructor

Parameters:
folder - - folder to list
filter - - filter criteria
recursive - - descend into subfolders
Method Detail

getFiles

public java.util.Collection getFiles()
getFiles return the collection of files found

Returns:
a Collection of File instances

getDirectories

public java.util.Collection getDirectories()
getDirectories returns a collection of directories found in the directorie(s) being searched.

Returns:
a Collection of File instances


(c) 1999-2005 by Ralph Jocham (rjocham72@netscape.net)
JCSC is released under the terms of the GNU General Public License