koala.dynamicjava.util
Class FileFinder

java.lang.Object
  extended bykoala.dynamicjava.util.FileFinder
Direct Known Subclasses:
LibraryFinder

public class FileFinder
extends java.lang.Object

This class represents an object that manages a set of path where to find files.


Constructor Summary
FileFinder()
          Creates a new file finder
 
Method Summary
 void addPath(java.lang.String path)
          Adds a search path.
 java.io.File findFile(java.lang.String name)
          Searches and returns a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFinder

public FileFinder()
Creates a new file finder

Method Detail

addPath

public void addPath(java.lang.String path)
Adds a search path. This path becomes the one with the highest priority.

Parameters:
path - the path to add

findFile

public java.io.File findFile(java.lang.String name)
                      throws java.io.IOException
Searches and returns a file.

Parameters:
name - the base name of the file to find
Throws:
java.io.IOException - if no file was found


Copyright © 2001 Stephane Hillion. All Rights Reserved.