Package org.apache.bcel.util
Class ModularRuntimeImage
- java.lang.Object
-
- org.apache.bcel.util.ModularRuntimeImage
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ModularRuntimeImage extends Object implements Closeable
Wraps 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(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()FileSystemgetFileSystem()List<Path>list(String dirName)Lists all entries in the given directory.List<Path>list(Path dirPath)Lists all entries in the given directory.List<Path>modules()Lists all modules.List<Path>packages()Lists all packages.
-
-
-
Constructor Detail
-
ModularRuntimeImage
public ModularRuntimeImage() throws IOExceptionConstructs a default instance.- Throws:
IOException- an I/O error occurs accessing the file system
-
ModularRuntimeImage
public ModularRuntimeImage(String javaHome) throws IOException
Constructs an instance using the JRT file system implementation from a specific Java Home.- Parameters:
javaHome- Path to a Java 9 or greater home.- Throws:
IOException- an I/O error occurs accessing the file system
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
list
public List<Path> list(Path dirPath) throws IOException
Lists all entries in the given directory.- Parameters:
dirPath- directory path.- Returns:
- a list of dir entries if an I/O error occurs
- Throws:
IOException- an I/O error occurs accessing the file system
-
list
public List<Path> list(String dirName) throws IOException
Lists all entries in the given directory.- Parameters:
dirName- directory path.- Returns:
- a list of dir entries if an I/O error occurs
- Throws:
IOException- an I/O error occurs accessing the file system
-
modules
public List<Path> modules() throws IOException
Lists all modules.- Returns:
- a list of modules
- Throws:
IOException- an I/O error occurs accessing the file system
-
packages
public List<Path> packages() throws IOException
Lists all packages.- Returns:
- a list of modules
- Throws:
IOException- an I/O error occurs accessing the file system
-
getFileSystem
public FileSystem getFileSystem()
-
-