public final class LocalModuleFinder extends java.lang.Object implements ModuleFinder
module.xml descriptors.| Modifier and Type | Field and Description |
|---|---|
private java.security.AccessControlContext |
accessControlContext |
private static java.io.File[] |
NO_FILES |
private PathFilter |
pathFilter |
private java.io.File[] |
repoRoots |
| Modifier | Constructor and Description |
|---|---|
|
LocalModuleFinder()
Construct a new instance, using the
module.path system property or the JAVA_MODULEPATH environment variable
to get the list of module repository roots. |
|
LocalModuleFinder(boolean supportLayersAndAddOns)
Construct a new instance, using the
module.path system property or the JAVA_MODULEPATH environment variable
to get the list of module repository roots. |
|
LocalModuleFinder(java.io.File[] repoRoots)
Construct a new instance.
|
|
LocalModuleFinder(java.io.File[] repoRoots,
PathFilter pathFilter)
Construct a new instance.
|
private |
LocalModuleFinder(java.io.File[] repoRoots,
PathFilter pathFilter,
boolean cloneRoots) |
| Modifier and Type | Method and Description |
|---|---|
ModuleSpec |
findModule(ModuleIdentifier identifier,
ModuleLoader delegateLoader)
Find a module specification for the given identifier.
|
private static java.io.File[] |
getFiles(java.lang.String modulePath,
int stringIdx,
int arrayIdx) |
private static java.io.File[] |
getModulePathFiles() |
(package private) static java.io.File[] |
getRepoRoots(boolean supportLayersAndAddOns) |
static ModuleSpec |
parseModuleXmlFile(ModuleIdentifier identifier,
ModuleLoader delegateLoader,
java.io.File... roots)
Parse a
module.xml file and return the corresponding module specification. |
private static java.lang.String |
toPathString(ModuleIdentifier moduleIdentifier) |
java.lang.String |
toString() |
private static final java.io.File[] NO_FILES
private final java.io.File[] repoRoots
private final PathFilter pathFilter
private final java.security.AccessControlContext accessControlContext
private LocalModuleFinder(java.io.File[] repoRoots,
PathFilter pathFilter,
boolean cloneRoots)
public LocalModuleFinder(java.io.File[] repoRoots,
PathFilter pathFilter)
repoRoots - the repository roots to usepathFilter - the path filter to usepublic LocalModuleFinder(java.io.File[] repoRoots)
repoRoots - the repository roots to usepublic LocalModuleFinder()
module.path system property or the JAVA_MODULEPATH environment variable
to get the list of module repository roots.
This is equivalent to a call to LocalModuleFinder(true).
public LocalModuleFinder(boolean supportLayersAndAddOns)
module.path system property or the JAVA_MODULEPATH environment variable
to get the list of module repository roots.supportLayersAndAddOns - true if the identified module repository roots should be checked for
an internal structure of child "layer" and "add-on" directories that may also
be treated as module roots lower in precedence than the parent root. Any "layers"
subdirectories whose names are specified in a layers.conf file found in
the module repository root will be added in the precedence of order specified
in the layers.conf file; all "add-on" subdirectories will be added at
a lower precedence than all "layers" and with no guaranteed precedence order
between them. If false no check for "layer" and "add-on" directories
will be performed.static java.io.File[] getRepoRoots(boolean supportLayersAndAddOns)
private static java.io.File[] getModulePathFiles()
private static java.io.File[] getFiles(java.lang.String modulePath,
int stringIdx,
int arrayIdx)
private static java.lang.String toPathString(ModuleIdentifier moduleIdentifier)
public ModuleSpec findModule(ModuleIdentifier identifier, ModuleLoader delegateLoader) throws ModuleLoadException
ModuleFinderfindModule in interface ModuleFinderidentifier - the module identifierdelegateLoader - the module loader from which dependencies should be resolvednull if no specification is found for this identifierModuleLoadExceptionpublic static ModuleSpec parseModuleXmlFile(ModuleIdentifier identifier, ModuleLoader delegateLoader, java.io.File... roots) throws java.io.IOException, ModuleLoadException
module.xml file and return the corresponding module specification.identifier - the identifier to loaddelegateLoader - the delegate module loader to use for module specificationsroots - the repository root paths to searchjava.io.IOException - if reading the module file failedModuleLoadException - if creating the module specification failed (e.g. due to a parse error)public java.lang.String toString()
toString in class java.lang.Object