/** * creates a new {@link IResourceStream} for given resource path with should be loaded by given * class loader. * * @param webjarsPath The resource to load * @return new {@link IResourceStream} instance that represents the content of given resource path or * null if resource wasn't found */ protected IResourceStream newResourceStream(final String webjarsPath) { return resourceStreamProvider.newResourceStream(webjarsPath); }
@Override public IResourceStreamProvider newInstance(ClassLoader... classLoaders) { return new UrlResourceStreamProvider(classLoaders); } };
/** * @return new resource locator instance */ protected IFullPathProvider newFullPathProvider() { return new WebJarAssetLocator(settings); }
/** * Construct. * * @param name The webjars path to load */ public WebjarsJavaScriptResourceReference(final String name) { super(WebjarsJavaScriptResourceReference.class, useRecent(name)); this.originalName = name; }
private String throwNotFoundException(final String partialPath) { throw new ResourceException(partialPath, partialPath + " could not be found. Make sure you've added the " + "corresponding WebJar and please check for typos."); }
@Override public IResourceStreamProvider newInstance(ClassLoader... classLoaders) { return new ClassLoaderResourceStreamProvider(classLoaders); } };
/** * Construct. * * @param name The webjars path to load */ public WebjarsCssResourceReference(final String name) { super(WebjarsCssResourceReference.class, prependWebjarsPathIfMissing(name)); this.originalName = name; }
public void reindex() { if (locator instanceof WebJarAssetLocator) { WebJarAssetLocator webJarAssetLocator = (WebJarAssetLocator) locator; webJarAssetLocator.reindex(); } }
/** * install all mustache configurations * * @param app current web application */ public static void install(Application app) { Webjars.install(app); }
@Override public String call() throws Exception { return collectRecentVersionFor(partialPath); }
@Override public void printStackTrace(PrintWriter s) { printStackTrace(); }
/** * Construct. * * @param name The webjars path to load */ public WebjarsCssResourceReference(final String name) { super(WebjarsCssResourceReference.class, useRecent(name)); this.originalName = name; }
private String throwMultipleMatchesException(final String partialPath) { throw new ResourceException(partialPath, "Multiple matches found for " + partialPath + ". Please provide a more specific path, for example by including a version number."); }
/** * creates a new {@link IResourceStream} for given resource path with should be loaded by given * class loader. * * @param webjarsPath The resource to load * @return new {@link IResourceStream} instance that represents the content of given resource path or * null if resource wasn't found */ protected IResourceStream newResourceStream(final String webjarsPath) { return resourceStreamProvider.newResourceStream(webjarsPath); }
@Override public IResourceStreamProvider newInstance(ClassLoader... classLoaders) { return new UrlResourceStreamProvider(classLoaders); } };
/** * @return new resource locator instance */ protected IFullPathProvider newFullPathProvider() { return new WebJarAssetLocator(settings); }
@Override public IResourceStreamProvider newInstance(ClassLoader... classLoaders) { return new ClassLoaderResourceStreamProvider(classLoaders); } },
/** * Construct. * * @param name The webjars path to load */ public WebjarsJavaScriptResourceReference(final String name) { super(WebjarsJavaScriptResourceReference.class, prependWebjarsPathIfMissing(name)); this.originalName = name; }
public void reindex() { if (locator instanceof WebJarAssetLocator) { WebJarAssetLocator webJarAssetLocator = (WebJarAssetLocator) locator; webJarAssetLocator.reindex(); } }
private String throwNotFoundException(final String partialPath) { throw new ResourceException(partialPath, partialPath + " could not be found. Make sure you've added the " + "corresponding WebJar and please check for typos."); }