APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.jrtfs

public abstract Class SystemImage

extends Object
implements AutoCloseable
Class Inheritance
All Implemented Interfaces
java.lang.AutoCloseable
Known Direct Subclasses
jdk.internal.jrtfs.ExplodedImage
Annotations
@SuppressWarnings:removal, suppression
Imports
java.io.IOException, java.net.URISyntaxException, .URL, java.nio.file.Files, .FileSystem, .FileSystems, .FileSystemNotFoundException, .Path, .Paths, java.security.AccessController, .CodeSource, .PrivilegedAction, jdk.internal.jimage.ImageReader, .ImageReader.Node, .PreviewMode

Implementation Note

This class needs to maintain JDK 8 source compatibility. It is used internally in the JDK to implement jimage/jrtfs access, but also compiled and delivered as part of the jrtfs.jar to support access to the jimage file provided by the shipped JDK by tools running on JDK 8.

Field Summary

Modifier and TypeField and Description
private static final Path
private static final Path
private static final boolean
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
close()

Redeclares java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources.

private static String
findHome()

Returns the appropriate JDK home for this usage of the FileSystemProvider.

public abstract ImageReader.Node
public static SystemImage
fromDirectory(Path modulesDir, PreviewMode mode)

Internal factory method for testing only, use SystemImage#open(PreviewMode).

public static SystemImage
fromJimage(Path path, PreviewMode mode)

Internal factory method for testing only, use SystemImage#open(PreviewMode).

public abstract byte[]
public static SystemImage

Returns:

a new system image based on either the jimage file or an "exploded" modules directory, according to the build state.
open
(PreviewMode
determines whether preview mode should be enabled.
mode
)

Opens the system image for the current runtime.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

explodedModulesDirback to summary
private static final Path explodedModulesDir
moduleImageFileback to summary
private static final Path moduleImageFile
modulesImageExistsback to summary
private static final boolean modulesImageExists
RUNTIME_HOMEback to summary
private static final String RUNTIME_HOME

Constructor Detail

SystemImageback to summary
public SystemImage()

Method Detail

closeback to summary
public abstract void close() throws IOException

Redeclares java.lang.AutoCloseable.close.

Doc from java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

findHomeback to summary
private static String findHome()

Returns the appropriate JDK home for this usage of the FileSystemProvider. When the CodeSource is null (null loader) then jrt:/ is the current runtime, otherwise the JDK home is located relative to jrt-fs.jar.

findNodeback to summary
public abstract ImageReader.Node findNode(String path) throws IOException
fromDirectoryback to summary
public static SystemImage fromDirectory(Path modulesDir, PreviewMode mode) throws IOException

Internal factory method for testing only, use SystemImage#open(PreviewMode).

fromJimageback to summary
public static SystemImage fromJimage(Path path, PreviewMode mode) throws IOException

Internal factory method for testing only, use SystemImage#open(PreviewMode).

getResourceback to summary
public abstract byte[] getResource(ImageReader.Node node) throws IOException
openback to summary
public static SystemImage open(PreviewMode mode) throws IOException

Opens the system image for the current runtime.

Parameters
mode:PreviewMode

determines whether preview mode should be enabled.

Returns:SystemImage

a new system image based on either the jimage file or an "exploded" modules directory, according to the build state.