Class DependencyResolver
java.lang.Object
org.nustaq.kontraktor.webapp.javascript.DependencyResolver
- All Implemented Interfaces:
HtmlImportShim.ResourceLocator
public class DependencyResolver extends Object implements HtmlImportShim.ResourceLocator
Created by ruedi on 06.04.2015.
Algorithm: starting from the root component (searched via resource path), resolve all dependencies
resulting in a list of (ordered according to dependencies) directories.
The resulting list is then searched in order when doing lookup/merge
-
Field Summary
Fields Modifier and Type Field Description protected StringbaseDirprotected File[]resourcePath -
Constructor Summary
Constructors Constructor Description DependencyResolver(String baseDir, String[] resourcePath, HtmlImportShim.ResourceLocator rl) -
Method Summary
Modifier and Type Method Description StringgetBaseDir()FilelocateResource(String name)iterate component directories in order and return full path of first file matchingStringresolveUniquePath(File fi)byte[]retrieveBytes(File impFi)this part of locator interface is only implemented if another resourcelocator is set.protected DependencyResolversetBaseDir(String baseDir)protected DependencyResolversetResourcePath(String... path)
-
Field Details
-
Constructor Details
-
DependencyResolver
public DependencyResolver(String baseDir, String[] resourcePath, HtmlImportShim.ResourceLocator rl)
-
-
Method Details
-
getBaseDir
-
setBaseDir
-
setResourcePath
-
locateResource
iterate component directories in order and return full path of first file matching- Specified by:
locateResourcein interfaceHtmlImportShim.ResourceLocator- Parameters:
name-- Returns:
-
retrieveBytes
this part of locator interface is only implemented if another resourcelocator is set.- Specified by:
retrieveBytesin interfaceHtmlImportShim.ResourceLocator- Parameters:
impFi-- Returns:
-
resolveUniquePath
-