org.apache.tapestry.asset
Class ContextAsset
java.lang.Object
org.apache.tapestry.asset.AbstractAsset
org.apache.tapestry.asset.ContextAsset
- All Implemented Interfaces:
- org.apache.hivemind.Locatable, IAsset
public class ContextAsset
- extends AbstractAsset
- implements IAsset
An asset whose path is relative to the ServletContextcontaining the
application.
- Author:
- Howard Lewis Ship
|
Constructor Summary |
ContextAsset(java.lang.String contextPath,
org.apache.hivemind.Resource resource,
org.apache.hivemind.Location location,
IRequestCycle cycle)
|
|
Method Summary |
java.lang.String |
buildURL()
Generates a URL for the client to retrieve the asset. |
java.io.InputStream |
getResourceAsStream()
Accesses the localized version of the resource (if possible) and returns it as an input
stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.hivemind.Locatable |
getLocation |
ContextAsset
public ContextAsset(java.lang.String contextPath,
org.apache.hivemind.Resource resource,
org.apache.hivemind.Location location,
IRequestCycle cycle)
buildURL
public java.lang.String buildURL()
- 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()
- 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
pageis returned.
- Specified by:
getResourceAsStream in interface IAsset