This project provides a means to locate assets within WebJars.
Find the specified partial path in any WebJar on the classpath:
WebJarAssetLocator locator = new WebJarAssetLocator();
String fullPathToBootstrap = locator.getFullPath("bootstrap.js");
Find the specified partial path in a specific WebJar:
WebJarAssetLocator locator = new WebJarAssetLocator();
String fullPathToBootstrap = locator.getFullPath("bootstrap", "bootstrap.js");
Get the full path to a file in a specific WebJar:
WebJarAssetLocator locator = new WebJarAssetLocator();
String fullPathToBootstrap = locator.getFullPathExact("bootstrap", "js/bootstrap.js");
WebJarAssetLocator locator = new WebJarAssetLocator();
Set<String> fullPathsOfAssets = locator.listAssets("/multiple/1.0.0");
The locator can also be configured with the class loaders that it should use for looking up resources and filter the types of resources that should be included for searching. Please visit the source code for more information.