Package ru.vyarus.guicey.gsp.app.util
Class ResourceLookup
- java.lang.Object
-
- ru.vyarus.guicey.gsp.app.util.ResourceLookup
-
public final class ResourceLookup extends java.lang.ObjectUtility used to lookup static resources in multiple locations. This is used for applications extensions mechanism when additional resources could be mapped into application from different classpath location.- Since:
- 04.12.2018
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidexistsOrFail(java.lang.String path, AssetLookup assets)Shortcut forAssetLookup.load(String)with fail in case of not found template.static java.lang.StringlookupOrFail(java.lang.String path, AssetLookup assets)Shortcut forAssetLookup.lookupPath(String)with fail in case of not found template.
-
-
-
Method Detail
-
lookupOrFail
public static java.lang.String lookupOrFail(java.lang.String path, AssetLookup assets) throws TemplateNotFoundExceptionShortcut forAssetLookup.lookupPath(String)with fail in case of not found template. Here path may be direct url (which must be properly mapped to classpath) or just relative path to search within of registered locations.- Parameters:
path- static resource pathassets- assets resolution object- Returns:
- resource location path (first occurrence)
- Throws:
TemplateNotFoundException- if template not found
-
existsOrFail
public static void existsOrFail(java.lang.String path, AssetLookup assets) throws TemplateNotFoundExceptionShortcut forAssetLookup.load(String)with fail in case of not found template.- Parameters:
path- path to check (absolute (/) or relative)assets- assets resolution object- Throws:
TemplateNotFoundException- if template not found
-
-