org.openware.util
Class DirSearch

java.lang.Object
  |
  +--org.openware.util.DirSearch

public class DirSearch
extends java.lang.Object

Utility for searching directories for files.


Constructor Summary
DirSearch()
           
 
Method Summary
 java.lang.String[] getAllDirectories(java.lang.String rootDir)
           
 java.lang.String[] getAllDirectories(java.lang.String rootDir, boolean recurse)
           
 java.lang.String[] getFilesWithExtension(java.lang.String rootDir, java.lang.String extension)
          Return an array of file names with the specified extension.
 java.lang.String[] getFilesWithExtension(java.lang.String rootDir, java.lang.String extension, boolean recurse)
          Return an array of file names with the specified extension.
static void main(java.lang.String[] args)
           
 void reset()
          Reset the DirSearch class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirSearch

public DirSearch()
Method Detail

reset

public void reset()
Reset the DirSearch class.

getFilesWithExtension

public java.lang.String[] getFilesWithExtension(java.lang.String rootDir,
                                                java.lang.String extension)
                                         throws DirSearchException
Return an array of file names with the specified extension. The method recursively visits all directories below rootDir.

getFilesWithExtension

public java.lang.String[] getFilesWithExtension(java.lang.String rootDir,
                                                java.lang.String extension,
                                                boolean recurse)
                                         throws DirSearchException
Return an array of file names with the specified extension. The method recursively visits all directories below rootDir.
Parameters:
rootDir - The root directory to start in.
extension - The extension to search for.
recurse - true if you want to recurse all subdirectories, false otherwise.
Returns:
An array of Strings.
Throws:
DirSearchException -  

getAllDirectories

public java.lang.String[] getAllDirectories(java.lang.String rootDir)
                                     throws DirSearchException

getAllDirectories

public java.lang.String[] getAllDirectories(java.lang.String rootDir,
                                            boolean recurse)
                                     throws DirSearchException

main

public static void main(java.lang.String[] args)
                 throws DirSearchException


Copyright © 2000, 2001 Openware, Spin Software. All Rights Reserved.