public class AssetSourceImpl extends Object implements AssetSource
Constructor and Description |
---|
AssetSourceImpl(ThreadLocale threadLocale,
Map<String,AssetFactory> configuration,
SymbolSource symbolSource) |
Modifier and Type | Method and Description |
---|---|
Asset |
getAsset(Resource baseResource,
String path,
Locale locale)
Finds the asset.
|
Asset |
getClasspathAsset(String path)
Obtains a classpath alias in the current locale (as defined by the
ThreadLocale service). |
Asset |
getClasspathAsset(String path,
Locale locale)
Convienience for finding assets on the classpath.
|
Asset |
getContextAsset(String path,
Locale locale)
Convienience for finding assets in the context.
|
Asset |
getExpandedAsset(String path)
|
Asset |
getUnlocalizedAsset(String path)
Find an asset but does not attempt to localize it.
|
Resource |
resourceForPath(String path)
Finds the asset, either on the classpath or (if prefixed), within the indicated domain.
|
public AssetSourceImpl(ThreadLocale threadLocale, Map<String,AssetFactory> configuration, SymbolSource symbolSource)
public Asset getClasspathAsset(String path)
AssetSource
ThreadLocale
service).getClasspathAsset
in interface AssetSource
path
- relative to the classpath rootpublic Asset getClasspathAsset(String path, Locale locale)
AssetSource
getClasspathAsset
in interface AssetSource
path
- path to the base resource, relative to classpath rootlocale
- to localize the resource topublic Asset getContextAsset(String path, Locale locale)
AssetSource
getContextAsset
in interface AssetSource
path
- path relative to the base resource (the context root)locale
- to localize the resource to, or null for the locale for the current requestpublic Asset getAsset(Resource baseResource, String path, Locale locale)
AssetSource
getAsset
in interface AssetSource
baseResource
- base resource for computing relative paths, or null to search the classpathpath
- relative to the base resourcelocale
- locale to localize the final resource to, or null for the thread's current localepublic Resource resourceForPath(String path)
AssetSource
resourceForPath
in interface AssetSource
path
- to the resource to provide as an Assetpublic Asset getExpandedAsset(String path)
AssetSource
getExpandedAsset
in interface AssetSource
public Asset getUnlocalizedAsset(String path)
AssetSource
getUnlocalizedAsset
in interface AssetSource
Copyright © 2003-2012 The Apache Software Foundation.