org.webjars
public class WebJarAssetLocator extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
WEBJARS_PACKAGE
The webjar package name.
|
static String |
WEBJARS_PATH_PREFIX
The path to where webjar resources live.
|
| Constructor and Description |
|---|
WebJarAssetLocator()
Convenience constructor that will form a locator for all resources on the
current class path.
|
WebJarAssetLocator(SortedMap<String,String> fullPathIndex)
Establish a locator given an index that it should use.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getFullPath(String partialPath)
Given a distinct path within the WebJar index passed in return the full
path of the resource.
|
String |
getFullPath(String webjar,
String partialPath)
Returns the full path of an asset within a specific WebJar
|
SortedMap<String,String> |
getFullPathIndex() |
static SortedMap<String,String> |
getFullPathIndex(Pattern filterExpr,
ClassLoader... classLoaders)
Return a map that can be used to perform index lookups of partial file
paths.
|
static Map.Entry<String,String> |
getWebJar(String path) |
Map<String,String> |
getWebJars() |
Set<String> |
listAssets(String folderPath)
List assets within a folder.
|
public static final String WEBJARS_PACKAGE
public static final String WEBJARS_PATH_PREFIX
public WebJarAssetLocator()
public static SortedMap<String,String> getFullPathIndex(Pattern filterExpr, ClassLoader... classLoaders)
filterExpr - the regular expression to be used to filter resources that
will be included in the index.classLoaders - the class loaders to be considered for loading the resources
from.public String getFullPath(String partialPath)
partialPath - the path to return e.g. "jquery.js" or "abc/someother.js".
This must be a distinct path within the index passed in.public String getFullPath(String webjar, String partialPath)
webjar - The id of the WebJar to searchpartialPath - The partial path to look forpublic Set<String> listAssets(String folderPath)
folderPath - the root path to the folder. Must begin with '/'.public Map<String,String> getWebJars()
Copyright © 2014. All Rights Reserved.