public class JRTUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
JRTUtil.JrtFileVisitor<T> |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JAVA_BASE |
static char[] |
JAVA_BASE_CHAR |
static java.lang.String |
JRT_FS_JAR |
static int |
NOTIFY_ALL |
static int |
NOTIFY_FILES |
static int |
NOTIFY_MODULES |
static int |
NOTIFY_PACKAGES |
| Constructor and Description |
|---|
JRTUtil() |
| Modifier and Type | Method and Description |
|---|---|
static ClassFileReader |
getClassfile(java.io.File jrt,
java.lang.String fileName,
IModule module) |
static ClassFileReader |
getClassfile(java.io.File jrt,
java.lang.String fileName,
java.lang.String module,
java.util.function.Predicate<java.lang.String> moduleNameFilter) |
static byte[] |
getClassfileContent(java.io.File jrt,
java.lang.String fileName,
java.lang.String module) |
static java.io.InputStream |
getContentFromJrt(java.io.File jrt,
java.lang.String fileName,
java.lang.String module) |
static org.aspectj.org.eclipse.jdt.internal.compiler.util.JrtFileSystem |
getJrtSystem(java.io.File image) |
static org.aspectj.org.eclipse.jdt.internal.compiler.util.JrtFileSystem |
getJrtSystem(java.io.File image,
java.lang.String release) |
static java.util.List<java.lang.String> |
getModulesDeclaringPackage(java.io.File jrt,
java.lang.String qName,
java.lang.String moduleName) |
static boolean |
hasCompilationUnit(java.io.File jrt,
java.lang.String qualifiedPackageName,
java.lang.String moduleName) |
static void |
reset()
TEST ONLY (use when changing the "modules.to.load" property).
|
static byte[] |
safeReadBytes(java.nio.file.Path path)
Tries to read all bytes of the file denoted by path,
returns null if the file could not be found or if the read was interrupted.
|
static java.lang.String |
sanitizedFileName(java.nio.file.Path path) |
static void |
walkModuleImage(java.io.File image,
JRTUtil.JrtFileVisitor<java.nio.file.Path> visitor,
int notify)
Given the path of a modular image file, this method walks the archive content and
notifies the supplied visitor about packages and files visited.
|
static void |
walkModuleImage(java.io.File image,
java.lang.String release,
JRTUtil.JrtFileVisitor<java.nio.file.Path> visitor,
int notify) |
public static final java.lang.String JAVA_BASE
public static final char[] JAVA_BASE_CHAR
public static final java.lang.String JRT_FS_JAR
public static int NOTIFY_FILES
public static int NOTIFY_PACKAGES
public static int NOTIFY_MODULES
public static int NOTIFY_ALL
public static org.aspectj.org.eclipse.jdt.internal.compiler.util.JrtFileSystem getJrtSystem(java.io.File image)
public static org.aspectj.org.eclipse.jdt.internal.compiler.util.JrtFileSystem getJrtSystem(java.io.File image,
java.lang.String release)
public static void reset()
public static void walkModuleImage(java.io.File image,
JRTUtil.JrtFileVisitor<java.nio.file.Path> visitor,
int notify)
throws java.io.IOException
NOTIFY_ALL,
NOTIFY_FILES, NOTIFY_PACKAGES and NOTIFY_MODULES.image - a java.io.File handle to the JRT image.visitor - an instance of JrtFileVisitor to be notified of the entries in the JRT image.notify - flag indicating the notifications the client is interested in.java.io.IOExceptionpublic static void walkModuleImage(java.io.File image,
java.lang.String release,
JRTUtil.JrtFileVisitor<java.nio.file.Path> visitor,
int notify)
throws java.io.IOException
java.io.IOExceptionpublic static java.io.InputStream getContentFromJrt(java.io.File jrt,
java.lang.String fileName,
java.lang.String module)
throws java.io.IOException
java.io.IOExceptionpublic static byte[] getClassfileContent(java.io.File jrt,
java.lang.String fileName,
java.lang.String module)
throws java.io.IOException,
ClassFormatException
java.io.IOExceptionClassFormatExceptionpublic static ClassFileReader getClassfile(java.io.File jrt, java.lang.String fileName, IModule module) throws java.io.IOException, ClassFormatException
java.io.IOExceptionClassFormatExceptionpublic static ClassFileReader getClassfile(java.io.File jrt, java.lang.String fileName, java.lang.String module, java.util.function.Predicate<java.lang.String> moduleNameFilter) throws java.io.IOException, ClassFormatException
java.io.IOExceptionClassFormatExceptionpublic static java.util.List<java.lang.String> getModulesDeclaringPackage(java.io.File jrt,
java.lang.String qName,
java.lang.String moduleName)
public static boolean hasCompilationUnit(java.io.File jrt,
java.lang.String qualifiedPackageName,
java.lang.String moduleName)
public static java.lang.String sanitizedFileName(java.nio.file.Path path)
public static byte[] safeReadBytes(java.nio.file.Path path)
throws java.io.IOException
path - java.io.IOException - any IO exception other than NoSuchFileException