Package org.apache.bcel.util
Class ModularRuntimeImage
- java.lang.Object
 - 
- org.apache.bcel.util.ModularRuntimeImage
 
 
- 
- All Implemented Interfaces:
 java.io.Closeable,java.lang.AutoCloseable
public class ModularRuntimeImage extends java.lang.Object implements java.io.CloseableWraps a Java 9 JEP 220 modular runtime image. Requires the JRT NIO file system.- Since:
 - 6.3
 
 
- 
- 
Constructor Summary
Constructors Constructor Description ModularRuntimeImage()Constructs a default instance.ModularRuntimeImage(java.lang.String javaHome)Constructs an instance using the JRT file system implementation from a specific Java Home. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.nio.file.FileSystemgetFileSystem()java.util.List<java.nio.file.Path>list(java.lang.String dirName)Lists all entries in the given directory.java.util.List<java.nio.file.Path>list(java.nio.file.Path dirPath)Lists all entries in the given directory.java.util.List<java.nio.file.Path>modules()Lists all modules.java.util.List<java.nio.file.Path>packages()Lists all packages. 
 - 
 
- 
- 
Constructor Detail
- 
ModularRuntimeImage
public ModularRuntimeImage() throws java.io.IOExceptionConstructs a default instance.- Throws:
 java.io.IOException- an I/O error occurs accessing the file system
 
- 
ModularRuntimeImage
public ModularRuntimeImage(java.lang.String javaHome) throws java.io.IOExceptionConstructs an instance using the JRT file system implementation from a specific Java Home.- Parameters:
 javaHome- Path to a Java 9 or greater home.- Throws:
 java.io.IOException- an I/O error occurs accessing the file system
 
 - 
 
- 
Method Detail
- 
close
public void close() throws java.io.IOException- Specified by:
 closein interfacejava.lang.AutoCloseable- Specified by:
 closein interfacejava.io.Closeable- Throws:
 java.io.IOException
 
- 
list
public java.util.List<java.nio.file.Path> list(java.nio.file.Path dirPath) throws java.io.IOExceptionLists all entries in the given directory.- Parameters:
 dirPath- directory path.- Returns:
 - a list of dir entries if an I/O error occurs
 - Throws:
 java.io.IOException- an I/O error occurs accessing the file system
 
- 
list
public java.util.List<java.nio.file.Path> list(java.lang.String dirName) throws java.io.IOExceptionLists all entries in the given directory.- Parameters:
 dirName- directory path.- Returns:
 - a list of dir entries if an I/O error occurs
 - Throws:
 java.io.IOException- an I/O error occurs accessing the file system
 
- 
modules
public java.util.List<java.nio.file.Path> modules() throws java.io.IOExceptionLists all modules.- Returns:
 - a list of modules
 - Throws:
 java.io.IOException- an I/O error occurs accessing the file system
 
- 
packages
public java.util.List<java.nio.file.Path> packages() throws java.io.IOExceptionLists all packages.- Returns:
 - a list of modules
 - Throws:
 java.io.IOException- an I/O error occurs accessing the file system
 
- 
getFileSystem
public java.nio.file.FileSystem getFileSystem()
 
 - 
 
 -