org.apache.tapestry.asset
Class ContextAsset

java.lang.Object
  extended by org.apache.tapestry.asset.AbstractAsset
      extended by org.apache.tapestry.asset.ContextAsset
All Implemented Interfaces:
IAsset, ILocatable

public class ContextAsset
extends AbstractAsset
implements IAsset

An asset whose path is relative to the ServletContext containing the application.

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

Constructor Summary
ContextAsset(ContextResourceLocation resourceLocation, ILocation location)
           
 
Method Summary
 String buildURL(IRequestCycle cycle)
          Generates a URL for the client to retrieve the asset.
 InputStream getResourceAsStream(IRequestCycle cycle)
          Accesses the localized version of the resource (if possible) and returns it as an input stream.
 
Methods inherited from class org.apache.tapestry.asset.AbstractAsset
getLocation, getResourceLocation, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IAsset
getResourceLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
getLocation
 

Constructor Detail

ContextAsset

public ContextAsset(ContextResourceLocation resourceLocation,
                    ILocation location)
Method Detail

buildURL

public String buildURL(IRequestCycle cycle)
Generates a URL for the client to retrieve the asset. The context path is prepended to the asset path, which means that assets deployed inside web applications will still work (if things are configured properly).

Specified by:
buildURL in interface IAsset

getResourceAsStream

public InputStream getResourceAsStream(IRequestCycle cycle)
Description copied from interface: IAsset
Accesses the localized version of the resource (if possible) and returns it as an input stream. A version of the resource localized to the current page is returned.

Specified by:
getResourceAsStream in interface IAsset