org.jaffa.util
Class FindFiles

java.lang.Object
  extended byorg.jaffa.util.FindFiles

public class FindFiles
extends Object

This class is used to locate files with the specified set of root search directories.

The root directorities and all of its sub folders will be searched for the specified file.

This has been optimized not to search the same directories if the several root paths intersect.

It currently does not support wildcard charaters in the filename parameter.

Example

     FindFiles x = new FindFiles( System.getProperty("java.class.path") , "ComponentDefinition.xml");
     List files = x.getList();
     if(files == null)
         System.out.println("No Files Found");
     else {
         for(Iterator it = files.iterator(); it.hasNext();) {
             File file = (File) it.next();
             System.out.println( file.getPath() );
         }
         System.out.println(files.size() + " File(s) Found");
     }
 

Version:
1.0
Author:
PaulE

Constructor Summary
FindFiles(String pathList, String filename)
          Create a file search object specifying the search root directories and the filename to seach for.
 
Method Summary
 List getList()
          Resursivly search the speecified pathList for any file with the specified name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindFiles

public FindFiles(String pathList,
                 String filename)
Create a file search object specifying the search root directories and the filename to seach for.

Note: the file name is case sensitive and does not support wild card characters.

Parameters:
pathList - A semicolon seperated list of root directories top be searched
filename - The name of the file to search for
Method Detail

getList

public List getList()
Resursivly search the speecified pathList for any file with the specified name

Returns:
A List of Files (java.io.File Objects) that matched the search criteria in the constructor


Copyright © 2002-2004 JAFFA Project.