public class ClasspathOrModulePathEntry extends Object
Modifier and Type | Field | Description |
---|---|---|
ClassLoader[] |
classLoaders |
The ClassLoader(s) used to load classes for this classpath element
|
Constructor | Description |
---|---|
ClasspathOrModulePathEntry(ModuleRef moduleRef,
NestedJarHandler nestedJarHandler,
LogNode log) |
A relative path for a module (in JDK9+).
|
ClasspathOrModulePathEntry(String pathToResolveAgainst,
String relativePath,
ClassLoader[] classLoaders,
NestedJarHandler nestedJarHandler,
ScanSpec scanSpec,
LogNode log) |
A relative path.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object o) |
Return true based on equality of canonical paths.
|
String |
getCanonicalPath(LogNode log) |
|
ClassLoader[] |
getClassLoaders() |
|
File |
getFile(LogNode log) |
|
String |
getJarfilePackageRoot() |
|
ModuleRef |
getModuleRef() |
|
String |
getResolvedPath() |
|
int |
hashCode() |
Hash based on canonical path.
|
boolean |
isClassfile() |
|
boolean |
isDirectory(LogNode log) |
|
boolean |
isFile(LogNode log) |
|
boolean |
isHttpURL() |
|
boolean |
isJrtURL() |
|
boolean |
isValidClasspathElement(ScanSpec scanSpec,
LogNode log) |
True if this relative path is a valid classpath element: that its path can be canonicalized, that it exists,
that it is a jarfile or directory, that it is not a blacklisted jar, that it should be scanned, etc.
|
String |
toString() |
Return the path.
|
public ClassLoader[] classLoaders
public ClasspathOrModulePathEntry(String pathToResolveAgainst, String relativePath, ClassLoader[] classLoaders, NestedJarHandler nestedJarHandler, ScanSpec scanSpec, LogNode log)
pathToResolveAgainst
- The base path.relativePath
- The relative path.classLoaders
- The environment classloaders.nestedJarHandler
- The NestedJarHandler
.scanSpec
- The ScanSpec
.log
- The log.public ClasspathOrModulePathEntry(ModuleRef moduleRef, NestedJarHandler nestedJarHandler, LogNode log)
moduleRef
- The ModuleRef
.nestedJarHandler
- The NestedJarHandler
.log
- The log.public ClassLoader[] getClassLoaders()
public String getResolvedPath()
public boolean isHttpURL()
public boolean isJrtURL()
public ModuleRef getModuleRef()
ModuleRef
for this module, if this ClasspathOrModulePathEntry
corresponds to a
module.public File getFile(LogNode log) throws IOException
log
- The log.IOException
- if the path cannot be canonicalized.public String getJarfilePackageRoot()
public String getCanonicalPath(LogNode log) throws IOException
log
- The log.File
object corresponding to the resolved path.IOException
- If there was an error in canonicalization.public boolean isFile(LogNode log) throws IOException
log
- The log.IOException
- If the file can't be read.public boolean isDirectory(LogNode log) throws IOException
log
- The log.IOException
- If the file can't be read.public boolean isClassfile()
public boolean isValidClasspathElement(ScanSpec scanSpec, LogNode log)
N.B. this has the side effect of fetching any http(s):// URLs, and/or unzipping any inner jarfiles, to determine if these paths are valid. Any resulting temporary files will be cached.
scanSpec
- The ScanSpec
.log
- The log.public boolean equals(Object o)
Copyright © 2018. All rights reserved.