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.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(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 void
close()
java.nio.file.FileSystem
getFileSystem()
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.IOException
Constructs 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.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:
java.io.IOException
- an I/O error occurs accessing the file system
-
-
Method Detail
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in 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.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:
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.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:
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.IOException
Lists 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.IOException
Lists 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()
-
-