public class WebJarAssetLocator
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
WEBJARS_PACKAGE
The webjar package name.
|
static java.lang.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(java.util.SortedMap<java.lang.String,java.lang.String> fullPathIndex)
Establish a locator given an index that it should use.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFullPath(java.lang.String partialPath)
Given a distinct path within the WebJar index passed in return the full
path of the resource.
|
java.lang.String |
getFullPath(java.lang.String webjar,
java.lang.String partialPath)
Returns the full path of an asset within a specific WebJar
|
java.util.SortedMap<java.lang.String,java.lang.String> |
getFullPathIndex() |
static java.util.SortedMap<java.lang.String,java.lang.String> |
getFullPathIndex(java.util.regex.Pattern filterExpr,
java.lang.ClassLoader... classLoaders)
Return a map that can be used to perform index lookups of partial file
paths.
|
static java.util.Map.Entry<java.lang.String,java.lang.String> |
getWebJar(java.lang.String path) |
java.util.Map<java.lang.String,java.lang.String> |
getWebJars() |
java.util.Set<java.lang.String> |
listAssets(java.lang.String folderPath)
List assets within a folder.
|
public static final java.lang.String WEBJARS_PACKAGE
public static final java.lang.String WEBJARS_PATH_PREFIX
public WebJarAssetLocator()
public WebJarAssetLocator(java.util.SortedMap<java.lang.String,java.lang.String> fullPathIndex)
fullPathIndex - the index to use.public static java.util.SortedMap<java.lang.String,java.lang.String> getFullPathIndex(java.util.regex.Pattern filterExpr,
java.lang.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 java.lang.String getFullPath(java.lang.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 java.lang.String getFullPath(java.lang.String webjar,
java.lang.String partialPath)
webjar - The id of the WebJar to searchpartialPath - The partial path to look forpublic java.util.SortedMap<java.lang.String,java.lang.String> getFullPathIndex()
public java.util.Set<java.lang.String> listAssets(java.lang.String folderPath)
folderPath - the root path to the folder. Must begin with '/'.public java.util.Map<java.lang.String,java.lang.String> getWebJars()
public static java.util.Map.Entry<java.lang.String,java.lang.String> getWebJar(java.lang.String path)
path - The full WebJar pathCopyright © 2015. All Rights Reserved.