de.agilecoders.wicket.webjars.util
Class WebJarAssetLocator

java.lang.Object
  extended by de.agilecoders.wicket.webjars.util.WebJarAssetLocator
All Implemented Interfaces:
IAssetProvider, IFullPathProvider

public class WebJarAssetLocator
extends Object
implements IAssetProvider, IFullPathProvider

Locate WebJar assets. The class is thread safe.


Nested Class Summary
static class WebJarAssetLocator.ResourceException
          resource exception without stacktrace.
 
Constructor Summary
WebJarAssetLocator(IWebjarsSettings settings)
          Convenience constructor that will form a locator for all resources on the current class path.
 
Method Summary
 String getFullPath(String partialPath)
          Given a distinct path within the WebJar index passed in return the full path of the resource.
 SortedMap<String,String> getFullPathIndex()
           
 Set<String> listAssets(String folderPath)
          List assets within a folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebJarAssetLocator

public WebJarAssetLocator(IWebjarsSettings settings)
Convenience constructor that will form a locator for all resources on the current class path.

Method Detail

getFullPath

public String getFullPath(String partialPath)
Description copied from interface: IFullPathProvider
Given a distinct path within the WebJar index passed in return the full path of the resource.

Specified by:
getFullPath in interface IFullPathProvider
Parameters:
partialPath - the path to return e.g. "jquery.js" or "abc/someother.js". This must be a distinct path within the index passed in.
Returns:
a fully qualified path to the resource.

getFullPathIndex

public SortedMap<String,String> getFullPathIndex()
Specified by:
getFullPathIndex in interface IAssetProvider
Returns:
the full path index map.

listAssets

public Set<String> listAssets(String folderPath)
Description copied from interface: IAssetProvider
List assets within a folder.

Specified by:
listAssets in interface IAssetProvider
Parameters:
folderPath - the root path to the folder. Must begin with '/'.
Returns:
a set of folder paths that match.


Copyright © 2016 agilecoders.de. All Rights Reserved.