org.apache.tapestry
Interface IAsset

All Superinterfaces:
org.apache.hivemind.Locatable
All Known Implementing Classes:
AbstractAsset, ContextAsset

public interface IAsset
extends org.apache.hivemind.Locatable

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.

Author:
Howard Lewis Ship

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

Method Detail

buildURL

public java.lang.String buildURL()
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 Localeof the current page) is returned.

Throws:
ApplicationRuntimeException - if the asset does not exist.

getResourceAsStream

public java.io.InputStream getResourceAsStream()
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.

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

getResourceLocation

public org.apache.hivemind.Resource getResourceLocation()
Returns the underlying location of the asset.