org.apache.tapestry.resource
Class ContextResourceLocation

java.lang.Object
  extended by org.apache.tapestry.resource.AbstractResourceLocation
      extended by org.apache.tapestry.resource.ContextResourceLocation
All Implemented Interfaces:
IResourceLocation

public class ContextResourceLocation
extends AbstractResourceLocation

Implementation of IResourceLocation for resources found within the web application context.

Since:
3.0
Version:
$Id: ContextResourceLocation.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Constructor Summary
ContextResourceLocation(ServletContext context, String path)
           
ContextResourceLocation(ServletContext context, String path, Locale locale)
           
 
Method Summary
protected  IResourceLocation buildNewResourceLocation(String path)
           
 IResourceLocation getLocalization(Locale locale)
          Locates the resource using LocalizedContextResourceFinder and ServletContext.getResource(java.lang.String).
 URL getResourceURL()
          Returns a URL for the resource.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class org.apache.tapestry.resource.AbstractResourceLocation
equals, getLocale, getName, getPath, getRelativeLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContextResourceLocation

public ContextResourceLocation(ServletContext context,
                               String path)

ContextResourceLocation

public ContextResourceLocation(ServletContext context,
                               String path,
                               Locale locale)
Method Detail

getLocalization

public IResourceLocation getLocalization(Locale locale)
Locates the resource using LocalizedContextResourceFinder and ServletContext.getResource(java.lang.String).

Parameters:
locale - to localize for, or null for no localization.
Returns:
a localized version of this resource, of null if the resource itself does not exist.

getResourceURL

public URL getResourceURL()
Description copied from interface: IResourceLocation
Returns a URL for the resource.

Returns:
the URL for the resource if it exists, or null if it does not

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

buildNewResourceLocation

protected IResourceLocation buildNewResourceLocation(String path)
Specified by:
buildNewResourceLocation in class AbstractResourceLocation