org.apache.tapestry
Interface IAsset

All Superinterfaces:
ILocatable
All Known Implementing Classes:
AbstractAsset, ContextAsset, ExternalAsset, PrivateAsset

public interface IAsset
extends ILocatable

Representation of a asset (GIF, JPEG, etc.) that may be owned by a IComponent.

Assets may be completely external (i.e., on some other web site), contained by the ServletContext, or stored somewhere in the classpath.

In the latter two cases, the resource may be localized.

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

Method Summary
 String buildURL(IRequestCycle cycle)
          Returns a URL for the asset, ready to be inserted into the output HTML.
 InputStream getResourceAsStream(IRequestCycle cycle)
          Accesses the localized version of the resource (if possible) and returns it as an input stream.
 IResourceLocation getResourceLocation()
          Returns the underlying location of the asset.
 
Methods inherited from interface org.apache.tapestry.ILocatable
getLocation
 

Method Detail

buildURL

String buildURL(IRequestCycle cycle)
Returns a URL for the asset, ready to be inserted into the output HTML. If the asset can be localized, the localized version (matching the Locale of the current page) is returned.

Throws:
ApplicationRuntimeException - if the asset does not exist.

getResourceAsStream

InputStream getResourceAsStream(IRequestCycle cycle)
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.

Throws:
ApplicationRuntimeException - if the asset does not exist, or can't be read.

getResourceLocation

IResourceLocation getResourceLocation()
Returns the underlying location of the asset.