org.ckkloverdos.resource
Class FileResourceContext

java.lang.Object
  extended by org.ckkloverdos.resource.ResourseContextSkeleton
      extended by org.ckkloverdos.resource.FileResourceContext
All Implemented Interfaces:
IResourceContext, IToStringAware

public class FileResourceContext
extends ResourseContextSkeleton
implements IToStringAware

Filesystem-based resource context.

Author:
Christos KK Loverdos

Constructor Summary
FileResourceContext(java.io.File root)
          Constructs a new context that will try to resolve resources from the provided filesystem location (root).
FileResourceContext(java.io.File[] roots)
          Constructs a new context that will try to resolve resources from the provided filesystem locations (roots).
FileResourceContext(java.io.File[] roots, IResourceContext parent)
          Constructs a new context that will try to resolve resources from the provided filesystem locations (roots).
FileResourceContext(java.io.File root, IResourceContext parent)
          Constructs a new context that will try to resolve resources from the provided filesystem location (root).
FileResourceContext(java.lang.String root)
          Constructs a new context that will try to resolve resources from the provided filesystem location (root).
 
Method Summary
 IResource getLocalResource(java.lang.String name)
          Returns the resource with the given name, using only the underlying file roots to resolve it (the parent context is not consulted).
 java.lang.String toString()
           
 void toStringAware(ToString ts)
           
 
Methods inherited from class org.ckkloverdos.resource.ResourseContextSkeleton
getParent, getResource, normalize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileResourceContext

public FileResourceContext(java.io.File[] roots,
                           IResourceContext parent)
Constructs a new context that will try to resolve resources from the provided filesystem locations (roots).

Parameters:
roots -
parent -

FileResourceContext

public FileResourceContext(java.io.File[] roots)
Constructs a new context that will try to resolve resources from the provided filesystem locations (roots).

Parameters:
roots -

FileResourceContext

public FileResourceContext(java.io.File root,
                           IResourceContext parent)
Constructs a new context that will try to resolve resources from the provided filesystem location (root).

Parameters:
root -
parent -

FileResourceContext

public FileResourceContext(java.io.File root)
Constructs a new context that will try to resolve resources from the provided filesystem location (root).

Parameters:
root -

FileResourceContext

public FileResourceContext(java.lang.String root)
Constructs a new context that will try to resolve resources from the provided filesystem location (root).

Parameters:
root -
Method Detail

getLocalResource

public IResource getLocalResource(java.lang.String name)
Returns the resource with the given name, using only the underlying file roots to resolve it (the parent context is not consulted).

Specified by:
getLocalResource in interface IResourceContext
Parameters:
name -
Returns:
the resource if found or EmptyResource.INSTANCE otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringAware

public void toStringAware(ToString ts)
Specified by:
toStringAware in interface IToStringAware


Copyright © 1999-2007 Christos KK Loverdos. All Rights Reserved.