APIdia Launch Partner
Top Fields Constructors Methods
jdk.jpackage.internal.util

public final Class RuntimeReleaseFile

extends Object
Class Inheritance
Imports
java.io.IOException, .Reader, java.nio.file.Files, .Path, java.util.List, .NoSuchElementException, .Optional, .Properties

Field Summary

Modifier and TypeField and Description
private final Properties

Constructor Summary

AccessConstructor and Description
public
RuntimeReleaseFile(Path releaseFilePath)

Method Summary

Modifier and TypeMethod and Description
public Optional<String>
findProperty(String
the property name
propertyName
)

Returns unquoted value of the property with the specified name or an empty Optional if there is no property with the specified name.

public Optional<String>
findRawProperty(String
the property name
propertyName
)

Returns verbatim value of the property with the specified name or an empty Optional if there is no property with the specified name.

public Runtime.Version
getJavaVersion()

Returns the value of the "JAVA_VERSION" property.

public List<String>
getModules()

Returns the value of the "MODULES" property.

public static RuntimeReleaseFile
loadFromRuntime(Path
the path to a directory with the standard Java runtime structure
runtimeDir
)

Creates the instance form the "runtime" file in the specified runtime directory.

public static Path
releaseFilePathInRuntime(Path
the path to a directory with the standard Java runtime structure
runtimeDir
)

Returns path to the "runtime" file in the specified runtime directory.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

propsback to summary
private final Properties props

Constructor Detail

RuntimeReleaseFileback to summary
public RuntimeReleaseFile(Path releaseFilePath) throws IOException

Method Detail

findPropertyback to summary
public Optional<String> findProperty(String propertyName)

Returns unquoted value of the property with the specified name or an empty Optional if there is no property with the specified name.

Property values in the "release" file are enclosed in double quotes. This method returns the value without the double quotes.

Parameters
propertyName:String

the property name

findRawPropertyback to summary
public Optional<String> findRawProperty(String propertyName)

Returns verbatim value of the property with the specified name or an empty Optional if there is no property with the specified name.

Property values in the "release" file are enclosed in double quotes. This method returns the value with the double quotes.

Parameters
propertyName:String

the property name

getJavaVersionback to summary
public Runtime.Version getJavaVersion()

Returns the value of the "JAVA_VERSION" property.

Will throw NoSuchElementException if there is no such property. Will use Runtime.Version#parse(String) method to parse version string. Any exception that it may yield will be passed to the caller verbatim.

Exceptions
NoSuchElementException:
if there is no such property
getModulesback to summary
public List<String> getModules()

Returns the value of the "MODULES" property.

Exceptions
NoSuchElementException:
if there is no such property
loadFromRuntimeback to summary
public static RuntimeReleaseFile loadFromRuntime(Path runtimeDir) throws IOException

Creates the instance form the "runtime" file in the specified runtime directory.

Uses releaseFilePathInRuntime(Path) to get the path to the "runtime" file in the specified runtime directory.

Parameters
runtimeDir:Path

the path to a directory with the standard Java runtime structure

releaseFilePathInRuntimeback to summary
public static Path releaseFilePathInRuntime(Path runtimeDir)

Returns path to the "runtime" file in the specified runtime directory.

Parameters
runtimeDir:Path

the path to a directory with the standard Java runtime structure