Package org.webjars

Class WebJarVersionLocator

java.lang.Object
org.webjars.WebJarVersionLocator

@NullMarked public class WebJarVersionLocator extends Object
Locate WebJar version. The class is thread safe.
  • Field Details

    • WEBJARS_PATH_PREFIX

      public static final String WEBJARS_PATH_PREFIX
      The path to where webjar resources live.
      See Also:
  • Constructor Details

    • WebJarVersionLocator

      public WebJarVersionLocator()
  • Method Details

    • fullPath

      public @Nullable String fullPath(String webJarName, String exactPath)
      Parameters:
      webJarName - The name of the WebJar, i.e. bootstrap
      exactPath - The path to the file within the WebJar, i.e. js/bootstrap.js
      Returns:
      The full path to the file in the classpath including the version, i.e. META-INF/resources/webjars/bootstrap/3.1.1/js/bootstrap.js
    • path

      public @Nullable String path(String webJarName, String exactPath)
      Parameters:
      webJarName - The name of the WebJar, i.e. bootstrap
      exactPath - The path to the file within the WebJar, i.e. js/bootstrap.js
      Returns:
      The path to the file in the standard WebJar classpath location, including the version, i.e. bootstrap/3.1.1/js/bootstrap.js
    • version

      public @Nullable String version(String webJarName)
      Parameters:
      webJarName - The name of the WebJar, i.e. bootstrap
      Returns:
      The version of the WebJar, i.e 3.1.1