org.apache.tapestry5.services
Interface ClasspathAssetAliasManager

All Known Implementing Classes:
ClasspathAssetAliasManagerImpl

@UsesMappedConfiguration(value=java.lang.String.class)
public interface ClasspathAssetAliasManager

Used as part of the support for classpath Assets, to convert the Asset's Resource to a URL that can be accessed by the client. The asset path, within the classpath, is converted into a shorter virtual path (one that, typically, includes some kind of version number).

Service configuration is a map from aliases (short names) to complete names. Names should not start or end end with a slash.


Method Summary
 String toClientURL(String resourcePath)
          Takes a resource path to a classpath resource and adds the asset path prefix to the path.
 String toResourcePath(String clientURL)
          Reverses toClientURL(String), stripping off the asset prefix, and re-expanding any aliased folders back to complete folders.
 

Method Detail

toClientURL

String toClientURL(String resourcePath)
Takes a resource path to a classpath resource and adds the asset path prefix to the path. May also convert part of the path to an alias (based on the manager's configuration).

Parameters:
resourcePath - resource path on the classpath (with no leading slash)
Returns:
URL ready to send to the client

toResourcePath

String toResourcePath(String clientURL)
Reverses toClientURL(String), stripping off the asset prefix, and re-expanding any aliased folders back to complete folders.



Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.