com.primix.tapestry.asset
Class ContextAsset

java.lang.Object
  |
  +--com.primix.tapestry.asset.ContextAsset
All Implemented Interfaces:
IAsset

public class ContextAsset
extends java.lang.Object
implements IAsset

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

Version:
$Id: ContextAsset.java,v 1.8 2001/09/24 13:29:06 hship Exp $
Author:
Howard Ship

Constructor Summary
ContextAsset(java.lang.String assetPath)
           
 
Method Summary
 java.lang.String buildURL(IRequestCycle cycle)
          Generates a URL for the client to retrieve the asset.
 java.io.InputStream getResourceAsStream(IRequestCycle cycle)
          Accesses the localized version of the resource (if possible) and returns it as an input stream.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContextAsset

public ContextAsset(java.lang.String assetPath)
Method Detail

buildURL

public java.lang.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 java.io.InputStream getResourceAsStream(IRequestCycle cycle)
                                        throws ResourceUnavailableException
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

toString

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