org.apache.myfaces.trinidad.resource
Class DirectoryResourceLoader

java.lang.Object
  extended by org.apache.myfaces.trinidad.resource.ResourceLoader
      extended by org.apache.myfaces.trinidad.resource.DirectoryResourceLoader

public class DirectoryResourceLoader
extends ResourceLoader

A resource loader implementation which loads resources from a directory. The returned resource URL will be null for file resources that do not exist, or for relative paths that attempt to access paths outside the root directory.

Author:
The Oracle ADF Faces Team

Constructor Summary
DirectoryResourceLoader(java.io.File directory)
          Constructs a new DirectoryResourceLoader.
DirectoryResourceLoader(java.io.File directory, ResourceLoader parent)
          Constructs a new DirectoryResourceLoader.
 
Method Summary
protected  java.net.URL findResource(java.lang.String path)
          Finds the resource with the given name.
 
Methods inherited from class org.apache.myfaces.trinidad.resource.ResourceLoader
getContentType, getNullResourceLoader, getParent, getResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryResourceLoader

public DirectoryResourceLoader(java.io.File directory)
Constructs a new DirectoryResourceLoader.

Parameters:
directory - the root directory

DirectoryResourceLoader

public DirectoryResourceLoader(java.io.File directory,
                               ResourceLoader parent)
Constructs a new DirectoryResourceLoader.

Parameters:
directory - the root directory
parent - the parent resource loader
Method Detail

findResource

protected java.net.URL findResource(java.lang.String path)
                             throws java.io.IOException
Description copied from class: ResourceLoader
Finds the resource with the given name. Resource loader implementations should override this method to specify where to find resources.

Overrides:
findResource in class ResourceLoader
Parameters:
path - The resource name
Returns:
A URL object for reading the resource, or null if the resource could not be found
Throws:
java.io.IOException


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.