Interface AppImageLayout
- All Known Subinterfaces:
ApplicationLayout,RuntimeLayout
- All Known Implementing Classes:
AppImageLayout.Stub
public interface AppImageLayout
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 Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordDefault implementation ofAppImageLayoutinterface. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturnstrueif the root directory of this app image layout is not an empty path, i.e, if it is not equal toPath.of("").map(UnaryOperator<Path> mapper) Returns a copy of this app image layout with the specified mapper applied to every path.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.default AppImageLayoutCreates a copy of this app image layout resolved at the given root directory.Root directory of this app image layout.A path to Java runtime directory.static PathGrouptoPathGroup(AppImageLayout appImageLayout) CreatesPathGroupobject from the givenAppImageLayoutinstance.default AppImageLayoutReturns 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 Details
-
runtimeDirectory
Path runtimeDirectory()A path to Java runtime directory. The directory should have standard JDK subdirectories like "bin", "lib", etc.- Returns:
- Java runtime sub-directory within this app image
-
rootDirectory
Path rootDirectory()Root directory of this app image layout. It should normally be equal toPath.of("")for unresolved layout.- Returns:
- the root directory of this app image layout
-
resetRootDirectory
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:
- an app image layout with the root directory set to an empty path
-
isResolved
default boolean isResolved()Returnstrueif the root directory of this app image layout is not an empty path, i.e, if it is not equal toPath.of("").- Returns:
trueif the root directory of this app image layout is not an empty path
-
resolveAt
Creates a copy of this app image layout resolved at the given root directory.- Parameters:
root- path to a directory at which to resolve the layout- Returns:
- a copy of this app image layout resolved at the given root directory
-
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:
- an app image layout resolved at
Path.of("")path
-
map
Returns a copy of this app image layout with the specified mapper applied to every path.- Parameters:
mapper- the mapper to use with every path in this app image layout.- Returns:
- the copy of this app image layout with the specified mapper applied to every path
-
toPathGroup
CreatesPathGroupobject from the givenAppImageLayoutinstance. It will call every non-static accessible method without parameters and withPathreturn type of the givenAppImageLayoutinstance exceptrootDirectory()method.For every call, it will save the return value in the output
PathGroupobject under the key equals the name of a function used in the call.- Parameters:
appImageLayout- source layout object- Returns:
PathGroupobject constructed from the given source layout object
-