com.tyenki.tree
Class ResourceLocator

java.lang.Object
  extended by com.tyenki.tree.ResourceLocator

public class ResourceLocator
extends Object

Locates the resources (schemas and templates) required by this library.

The default resource locator looks for the resources in the following order: - file system (default is current) - resource on classpath

Version:
8 January 2009
Author:
Christophe Lauret

Constructor Summary
ResourceLocator()
          Creates a new default resource locator to the current directory.
ResourceLocator(File root)
          Creates a new resource locator using the specified directory to search for resources.
 
Method Summary
 URL getResource(String name)
          Returns the location of the resource with the specified name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceLocator

public ResourceLocator()
Creates a new default resource locator to the current directory.


ResourceLocator

public ResourceLocator(File root)
Creates a new resource locator using the specified directory to search for resources.

Parameters:
root - The root of the resource directory.
Method Detail

getResource

public URL getResource(String name)
Returns the location of the resource with the specified name.

Returns:
The location of the resource with the specified name.