public class ModularRuntimeImage extends Object implements Closeable
Constructor and Description |
---|
ModularRuntimeImage()
Constructs a default instance.
|
ModularRuntimeImage(String javaHome)
Constructs an instance using the JRT file system implementation from a specific Java Home.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
FileSystem |
getFileSystem() |
List<Path> |
list(Path dirPath)
Lists all entries in the given directory.
|
List<Path> |
list(String dirName)
Lists all entries in the given directory.
|
List<Path> |
modules()
Lists all modules.
|
List<Path> |
packages()
Lists all packages.
|
public ModularRuntimeImage() throws IOException
IOException
- an I/O error occurs accessing the file systempublic ModularRuntimeImage(String javaHome) throws IOException
javaHome
- Path to a Java 9 or greater home.IOException
- an I/O error occurs accessing the file systempublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public List<Path> list(Path dirPath) throws IOException
dirPath
- directory path.IOException
- an I/O error occurs accessing the file systempublic List<Path> list(String dirName) throws IOException
dirName
- directory path.IOException
- an I/O error occurs accessing the file systempublic List<Path> modules() throws IOException
IOException
- an I/O error occurs accessing the file systempublic List<Path> packages() throws IOException
IOException
- an I/O error occurs accessing the file systempublic FileSystem getFileSystem()
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.