Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tapestry5.internal.services
Class AssetSourceImpl

    java.lang.Object
      org.apache.tapestry5.internal.services.AssetSourceImpl

All Implemented Interfaces:
  AssetSource

    public class AssetSourceImpl

extends java.lang.Object
implements AssetSource

Constructor Summary
`AssetSourceImpl(ThreadLocale threadLocale, java.util.Map<java.lang.String,AssetFactory> configuration, SymbolSource symbolSource)`

Method Summary
`Asset` | `getAsset(Resource baseResource, java.lang.String path, java.util.Locale locale)` Finds the asset.
`Asset` | `getClasspathAsset(java.lang.String path)` Obtains a classpath alias in the current locale (as defined by the `ThreadLocale` service).
`Asset` | `getClasspathAsset(java.lang.String path, java.util.Locale locale)` Convienience for finding assets on the classpath.
`Asset` | `getContextAsset(java.lang.String path, java.util.Locale locale)` Convienience for finding assets in the context.
`Asset` | `getExpandedAsset(java.lang.String path)` As with `AssetSource.getUnlocalizedAsset(String)`, but symbols in the path are expanded.
`Asset` | `getUnlocalizedAsset(java.lang.String path)` Find an asset but does not attempt to localize it.
`Resource` | `resourceForPath(java.lang.String path)` Finds the asset, either on the classpath or (if prefixed), within the indicated domain.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AssetSourceImpl

    public AssetSourceImpl(ThreadLocale threadLocale,
                           java.util.Map<java.lang.String,AssetFactory> configuration,
                           SymbolSource symbolSource)

Method Detail

### getClasspathAsset

    public Asset getClasspathAsset(java.lang.String path)

  Description copied from interface: `AssetSource`
  Obtains a classpath alias in the current locale (as defined by the `ThreadLocale` service).

  Specified by:
    `getClasspathAsset` in interface `AssetSource`
  Parameters:
    `path` - relative to the classpath root
  Returns:
    the asset

### getClasspathAsset

    public Asset getClasspathAsset(java.lang.String path,
                                   java.util.Locale locale)

  Description copied from interface: `AssetSource`
  Convienience for finding assets on the classpath.

  Specified by:
    `getClasspathAsset` in interface `AssetSource`
  Parameters:
    `path` - path to the base resource, relative to classpath root
    `locale` - to localize the resource to
  Returns:
    the asset

### getContextAsset

    public Asset getContextAsset(java.lang.String path,
                                 java.util.Locale locale)

  Description copied from interface: `AssetSource`
  Convienience for finding assets in the context.

  Specified by:
    `getContextAsset` in interface `AssetSource`
  Parameters:
    `path` - path relative to the base resource (the context root)
    `locale` - to localize the resource to, or null for the locale for the current request
  Returns:
    the asset

### getAsset

    public Asset getAsset(Resource baseResource,
                          java.lang.String path,
                          java.util.Locale locale)

  Description copied from interface: `AssetSource`
  Finds the asset. The path may either be a simple file name or a relative path (relative to the base resource) or it may have a prefix, such as "context:" or "classpath:", in which case it is treated as a complete path within the indicated domain. The resulting Resource is then localized (to the provided Locale) and returned as an Asset.

  The AssetSource caches its results, so a single Asset instance may be shared among many different components.

  Specified by:
    `getAsset` in interface `AssetSource`
  Parameters:
    `baseResource` - base resource for computing relative paths, or null to search the classpath
    `path` - relative to the base resource
    `locale` - locale to localize the final resource to, or null for the thread's current locale
  Returns:
    the asset

### resourceForPath

    public Resource resourceForPath(java.lang.String path)

  Description copied from interface: `AssetSource`
  Finds the asset, either on the classpath or (if prefixed), within the indicated domain. The result is not localized. The underlying Asset may not exist.

  Specified by:
    `resourceForPath` in interface `AssetSource`
  Parameters:
    `path` - to the resource to provide as an Asset
  Returns:
    Resource for the path (the Resource may not exist)

### getExpandedAsset

    public Asset getExpandedAsset(java.lang.String path)

  Description copied from interface: `AssetSource`
  As with `AssetSource.getUnlocalizedAsset(String)`, but symbols in the path are expanded.

  Specified by:
    `getExpandedAsset` in interface `AssetSource`

### getUnlocalizedAsset

    public Asset getUnlocalizedAsset(java.lang.String path)

  Description copied from interface: `AssetSource`
  Find an asset but does not attempt to localize it. If the path has no prefix, it is assumed to be on the classpath.

  Specified by:
    `getUnlocalizedAsset` in interface `AssetSource`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 The Apache Software Foundation.