Class DependencyResolver
java.lang.Object
org.nustaq.kontraktor.webapp.javascript.DependencyResolver
- All Implemented Interfaces:
HtmlImportShim.ResourceLocator
public class DependencyResolver extends java.lang.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 java.lang.StringbaseDirprotected java.io.File[]resourcePath -
Constructor Summary
Constructors Constructor Description DependencyResolver(java.lang.String baseDir, java.lang.String[] resourcePath, HtmlImportShim.ResourceLocator rl) -
Method Summary
Modifier and Type Method Description java.lang.StringgetBaseDir()java.io.FilelocateResource(java.lang.String name)iterate component directories in order and return full path of first file matchingjava.lang.StringresolveUniquePath(java.io.File fi)byte[]retrieveBytes(java.io.File impFi)this part of locator interface is only implemented if another resourcelocator is set.protected DependencyResolversetBaseDir(java.lang.String baseDir)protected DependencyResolversetResourcePath(java.lang.String... path)
-
Field Details
-
resourcePath
protected java.io.File[] resourcePath -
baseDir
protected java.lang.String baseDir
-
-
Constructor Details
-
DependencyResolver
public DependencyResolver(java.lang.String baseDir, java.lang.String[] resourcePath, HtmlImportShim.ResourceLocator rl)
-
-
Method Details
-
getBaseDir
public java.lang.String getBaseDir() -
setBaseDir
-
setResourcePath
-
locateResource
public java.io.File locateResource(java.lang.String name)iterate component directories in order and return full path of first file matching- Specified by:
locateResourcein interfaceHtmlImportShim.ResourceLocator- Parameters:
name-- Returns:
-
retrieveBytes
public byte[] retrieveBytes(java.io.File impFi)this part of locator interface is only implemented if another resourcelocator is set.- Specified by:
retrieveBytesin interfaceHtmlImportShim.ResourceLocator- Parameters:
impFi-- Returns:
-
resolveUniquePath
public java.lang.String resolveUniquePath(java.io.File fi)
-