APIdia Launch Partner
Top Description Inners Methods
jdk.jpackage.internal.model

public Interface AppImageLayout

Known Direct Subinterfaces
jdk.jpackage.internal.model.ApplicationLayout, jdk.jpackage.internal.model.RuntimeLayout
Known Direct Implementers
jdk.jpackage.internal.model.AppImageLayout.Stub
Static Imports
jdk.jpackage.internal.util.PathUtils.mapNullablePath, jdk.jpackage.internal.util.function.ThrowingFunction.toFunction

Generic app image directory layout. App image layout is a collection of files and directories with specific roles (executables, configuration files, etc.) sharing the same root directory.

The layout is "unresolved" if the root directory is an empty path (Path.of("")) and "resolved" otherwise.

The return value of the runtimeDirectory() method call is always a path starting with the path returned by the rootDirectory() method call. Public methods without parameters and with the return type Path in the derived interfaces must comply to this constrain.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
AppImageLayout.Stub

Default implementation of AppImageLayout interface.

Method Summary

Modifier and TypeMethod and Description
public default boolean

Returns:

true if the root directory of this app image layout is not an empty path
isResolved
()

Returns true if the root directory of this app image layout is not an empty path, i.e, if it is not equal to Path.of("").

public AppImageLayout

Returns:

the copy of this app image layout with the specified mapper applied to every path
map
(UnaryOperator<Path>
the mapper to use with every path in this app image layout.
mapper
)

Returns a copy of this app image layout with the specified mapper applied to every path.

public AppImageLayout

Returns:

an app image layout with the root directory set to an empty path
resetRootDirectory
()

Returns a copy of this app image layout with the root directory set to an empty path (Path.of("")) or this instance if its root directory is already an empty path.

public default AppImageLayout

Returns:

a copy of this app image layout resolved at the given root directory
resolveAt
(Path
path to a directory at which to resolve the layout
root
)

Creates a copy of this app image layout resolved at the given root directory.

public Path

Returns:

the root directory of this app image layout
rootDirectory
()

Root directory of this app image layout.

public Path

Returns:

Java runtime sub-directory within this app image
runtimeDirectory
()

A path to Java runtime directory.

public static PathGroup

Returns:

PathGroup object constructed from the given source layout object
toPathGroup
(AppImageLayout
source layout object
appImageLayout
)

Creates PathGroup object from the given AppImageLayout instance.

public default AppImageLayout

Returns:

an app image layout resolved at Path.of("") path
unresolve
()

Returns a copy of this app image layout resolved such that its root directory is set to an empty path (Path.of("")) or this instance if its root directory is already an empty path.

Method Detail

isResolvedback to summary
public default boolean isResolved()

Returns true if the root directory of this app image layout is not an empty path, i.e, if it is not equal to Path.of("").

Returns:boolean

true if the root directory of this app image layout is not an empty path

mapback to summary
public AppImageLayout map(UnaryOperator<Path> mapper)

Returns a copy of this app image layout with the specified mapper applied to every path.

Parameters
mapper:UnaryOperator<Path>

the mapper to use with every path in this app image layout.

Returns:AppImageLayout

the copy of this app image layout with the specified mapper applied to every path

resetRootDirectoryback to summary
public AppImageLayout resetRootDirectory()

Returns a copy of this app image layout with the root directory set to an empty path (Path.of("")) or this instance if its root directory is already an empty path.

Returns:AppImageLayout

an app image layout with the root directory set to an empty path

resolveAtback to summary
public default AppImageLayout resolveAt(Path root)

Creates a copy of this app image layout resolved at the given root directory.

Parameters
root:Path

path to a directory at which to resolve the layout

Returns:AppImageLayout

a copy of this app image layout resolved at the given root directory

rootDirectoryback to summary
public Path rootDirectory()

Root directory of this app image layout. It should normally be equal to Path.of("") for unresolved layout.

Returns:Path

the root directory of this app image layout

runtimeDirectoryback to summary
public Path runtimeDirectory()

A path to Java runtime directory. The directory should have standard JDK subdirectories like "bin", "lib", etc.

Returns:Path

Java runtime sub-directory within this app image

toPathGroupback to summary
public static PathGroup toPathGroup(AppImageLayout appImageLayout)

Creates PathGroup object from the given AppImageLayout instance. It will call every non-static accessible method without parameters and with Path return type of the given AppImageLayout instance except rootDirectory() method.

For every call, it will save the return value in the output PathGroup object under the key equals the name of a function used in the call.

Parameters
appImageLayout:AppImageLayout

source layout object

Returns:PathGroup

PathGroup object constructed from the given source layout object

unresolveback to summary
public default AppImageLayout unresolve()

Returns a copy of this app image layout resolved such that its root directory is set to an empty path (Path.of("")) or this instance if its root directory is already an empty path.

Returns:AppImageLayout

an app image layout resolved at Path.of("") path

jdk.jpackage.internal.model back to summary

public final Record AppImageLayout.Stub

extends Record
implements AppImageLayout
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.model.AppImageLayout
Record Components
rootDirectory:Path 
runtimeDirectory:Path 

Default implementation of AppImageLayout interface.

Field Summary

Modifier and TypeField and Description
private final Path
rootDirectory

Record Component accessed by rootDirectory().

private final Path
runtimeDirectory

Record Component accessed by runtimeDirectory().

Constructor Summary

AccessConstructor and Description
public
Stub(Path rootDirectory, Path runtimeDirectory)

public
Stub(Path runtimeDirectory)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public AppImageLayout
map(UnaryOperator<Path> mapper)

Implements jdk.jpackage.internal.model.AppImageLayout.map.

Returns a copy of this app image layout with the specified mapper applied to every path.

public AppImageLayout
resetRootDirectory()

Implements jdk.jpackage.internal.model.AppImageLayout.resetRootDirectory.

Returns a copy of this app image layout with the root directory set to an empty path (Path.of("")) or this instance if its root directory is already an empty path.

public Path
rootDirectory()

Record Component getter of rootDirectory.

Implements jdk.jpackage.internal.model.AppImageLayout.rootDirectory.

Root directory of this app image layout.

public Path
runtimeDirectory()

Record Component getter of runtimeDirectory.

Implements jdk.jpackage.internal.model.AppImageLayout.runtimeDirectory.

A path to Java runtime directory.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

rootDirectoryback to summary
private final Path rootDirectory

Record Component accessed by rootDirectory().

runtimeDirectoryback to summary
private final Path runtimeDirectory

Record Component accessed by runtimeDirectory().

Constructor Detail

Stubback to summary
public Stub(Path rootDirectory, Path runtimeDirectory)
Stubback to summary
public Stub(Path runtimeDirectory)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

mapback to summary
public AppImageLayout map(UnaryOperator<Path> mapper)

Implements jdk.jpackage.internal.model.AppImageLayout.map.

Doc from jdk.jpackage.internal.model.AppImageLayout.map.

Returns a copy of this app image layout with the specified mapper applied to every path.

Annotations
@Override
resetRootDirectoryback to summary
public AppImageLayout resetRootDirectory()

Implements jdk.jpackage.internal.model.AppImageLayout.resetRootDirectory.

Doc from jdk.jpackage.internal.model.AppImageLayout.resetRootDirectory.

Returns a copy of this app image layout with the root directory set to an empty path (Path.of("")) or this instance if its root directory is already an empty path.

Annotations
@Override
rootDirectoryback to summary
public Path rootDirectory()

Record Component getter of rootDirectory.

Implements jdk.jpackage.internal.model.AppImageLayout.rootDirectory.

Doc from jdk.jpackage.internal.model.AppImageLayout.rootDirectory.

Root directory of this app image layout. It should normally be equal to Path.of("") for unresolved layout.

runtimeDirectoryback to summary
public Path runtimeDirectory()

Record Component getter of runtimeDirectory.

Implements jdk.jpackage.internal.model.AppImageLayout.runtimeDirectory.

Doc from jdk.jpackage.internal.model.AppImageLayout.runtimeDirectory.

A path to Java runtime directory. The directory should have standard JDK subdirectories like "bin", "lib", etc.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.