public class WebJarAssetLocator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
WebJarAssetLocator.WebJarInfo |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,WebJarAssetLocator.WebJarInfo> |
allWebJars |
static String |
WEBJARS_PACKAGE
The webjar package name.
|
static String |
WEBJARS_PATH_PREFIX
The path to where webjar resources live.
|
| Constructor and Description |
|---|
WebJarAssetLocator() |
WebJarAssetLocator(io.github.classgraph.ClassGraph classGraph) |
WebJarAssetLocator(ClassLoader classLoader) |
WebJarAssetLocator(ClassLoader classLoader,
String... whitelistPaths) |
WebJarAssetLocator(Map<String,WebJarAssetLocator.WebJarInfo> allWebJars) |
WebJarAssetLocator(String... whitelistPaths) |
| Modifier and Type | Method and Description |
|---|---|
protected static Map<String,WebJarAssetLocator.WebJarInfo> |
findWebJars(io.github.classgraph.ScanResult scanResult) |
Map<String,WebJarAssetLocator.WebJarInfo> |
getAllWebJars() |
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
|
String |
getFullPathExact(String webJarName,
String exactPath)
Returns the full path of an asset within a specific WebJar
|
static Map.Entry<String,String> |
getWebJar(CharSequence path) |
Map<String,String> |
getWebJars() |
String |
groupId(String fullPath)
Gets the Group ID given a fullPath
|
Set<String> |
listAssets() |
Set<String> |
listAssets(String folderPath)
List assets within a folder.
|
protected static io.github.classgraph.ResourceList |
webJarResources(String webJarName,
io.github.classgraph.ResourceList resources) |
protected static String |
webJarVersion(String webJarName,
io.github.classgraph.ResourceList resources) |
public static final String WEBJARS_PACKAGE
public static final String WEBJARS_PATH_PREFIX
protected final Map<String,WebJarAssetLocator.WebJarInfo> allWebJars
public WebJarAssetLocator()
public WebJarAssetLocator(@Nullable ClassLoader classLoader)
public WebJarAssetLocator(@Nullable ClassLoader classLoader, @Nonnull String... whitelistPaths)
public WebJarAssetLocator(io.github.classgraph.ClassGraph classGraph)
public WebJarAssetLocator(@Nonnull Map<String,WebJarAssetLocator.WebJarInfo> allWebJars)
public Map<String,WebJarAssetLocator.WebJarInfo> getAllWebJars()
@Nonnull protected static io.github.classgraph.ResourceList webJarResources(@Nonnull String webJarName, @Nonnull io.github.classgraph.ResourceList resources)
@Nullable protected static String webJarVersion(@Nullable String webJarName, @Nonnull io.github.classgraph.ResourceList resources)
@Nonnull protected static Map<String,WebJarAssetLocator.WebJarInfo> findWebJars(@Nonnull io.github.classgraph.ScanResult scanResult)
@Nullable public static Map.Entry<String,String> getWebJar(@Nonnull CharSequence path)
path - The full WebJar path (not null)null if not a legal WebJar file format@Nonnull public String getFullPath(@Nonnull 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 (not null or empty).@Nonnull public String getFullPath(@Nonnull String webjar, @Nonnull String partialPath)
webjar - The id of the WebJar to search (not nullpartialPath - The partial path to look for (not nullNotFoundException - if webjar or path not found@Nullable public String getFullPathExact(@Nonnull String webJarName, @Nullable String exactPath)
webJarName - The id of the WebJar to search (must not be nullexactPath - The exact path of the file within the WebJar (may be null for legacy reasons)null if WebJar not found@Nonnull public Set<String> listAssets(@Nonnull String folderPath)
folderPath - the root path to the folder.@Nonnull public Map<String,String> getWebJars()
Copyright © 2012–2023. All rights reserved.