org.ceryle.util
Class DirectoryList

java.lang.Object
  extended by java.io.File
      extended by org.ceryle.util.DirectoryList
All Implemented Interfaces:
Serializable, Comparable<File>

public class DirectoryList
extends File

An extension of File that populates a provided Stack with a list of files matching a file filter, recursively processing subdirectories. If the filter is not set (ie., it is null), all files are matched.

Since:
JDK1.1.5
Version:
$Id: DirectoryList.java,v 3.3 2007-06-15 12:09:55 altheim Exp $
Author:
Murray Altheim
See Also:
Serialized Form

Field Summary
static boolean useURLs
          When true, the form of returned files will be as 'file:' URLs.
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
DirectoryList(File directory, Stack files, FileFilter filter)
          Constructor with a File directory, the Stack files to be populated, and the optional FileFilter filter to be used.
DirectoryList(String directoryName, Stack files, FileFilter filter)
          Constructor with a String directoryName, the Stack files to be populated, and the optional FileFilter filter to be used.
 
Method Summary
 void addPathname(int depth)
          Add path file name to Vector listing.
 void buildList()
          List all files in the current directory, using the internal list of file extensions as filter.
 void buildList(int depth)
          Recursively list all files in directory to depth depth, using the file filter to determine acceptable files.
 void setFilter(FileFilter filter)
          Set the FileFilter used to filter.
 
Methods inherited from class java.io.File
canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

useURLs

public static boolean useURLs
When true, the form of returned files will be as 'file:' URLs.

Constructor Detail

DirectoryList

public DirectoryList(String directoryName,
                     Stack files,
                     FileFilter filter)
Constructor with a String directoryName, the Stack files to be populated, and the optional FileFilter filter to be used.


DirectoryList

public DirectoryList(File directory,
                     Stack files,
                     FileFilter filter)
Constructor with a File directory, the Stack files to be populated, and the optional FileFilter filter to be used.

Method Detail

addPathname

public void addPathname(int depth)
Add path file name to Vector listing.


setFilter

public void setFilter(FileFilter filter)
Set the FileFilter used to filter.


buildList

public void buildList()
List all files in the current directory, using the internal list of file extensions as filter.


buildList

public void buildList(int depth)
Recursively list all files in directory to depth depth, using the file filter to determine acceptable files.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.