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

public non-sealed Interface Package

extends BundleSpec
Known Direct Subinterfaces
jdk.jpackage.internal.model.LinuxPackage
Known Direct Implementers
jdk.jpackage.internal.model.Package.Stub
Imports
java.nio.file.Path, java.util.Optional

Native application package. The interface specifies the source app image and the installed app image layouts.

Use appImageLayout() or asApplicationLayout() to get the unresolved source app image layout.

Installed app image layout is the layout of the installed app image.

Use installedPackageLayout() or asInstalledPackageApplicationLayout() to get the installed app image layout.

The following table shows app image layouts of the application named "Duke" on different platforms:

Source app image layout Installed app image layout
Windows bin/foo.exe app/foo.jar Duke/bin/foo.exe Duke/app/foo.jar
Linux bin/foo lib/app/foo.jar /opt/duke/bin/foo /opt/duke/lib/app/foo.jar
OSX Contents/MacOS/foo Contents/app/foo.jar /Applications/Duke.app/Contents/MacOS/foo /Applications/Duke.app/Contents/app/foo.jar

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
Package.Stub

Default implementation of Package interface.

Method Summary

Modifier and TypeMethod and Description
public Optional<String>

Returns:

the "About" URL of this package
aboutURL
()

Gets the "About" URL of this package if available or an empty Optional instance otherwise.

public Application

Returns:

the application of this package
app
()

Gets the application of this package.

public default AppImageLayout

Returns:

the unresolved app image layout of the application of this package
appImageLayout
()

Gets the unresolved source app image layout of the application of this package.

public default Optional<ApplicationLayout>

Returns:

the unresolved source app image layout of the application of this package as ApplicationLayout type
asApplicationLayout
()

Returns the unresolved source app image layout of the application of this package as ApplicationLayout type or an empty Optional instance if the layout object is of incompatible type.

public default Optional<ApplicationLayout>

Returns:

the layout of the installed app image of this package as ApplicationLayout type
asInstalledPackageApplicationLayout
()

Returns the layout of the installed app image of this package as ApplicationLayout type or an empty Optional instance if the layout object is of incompatible type.

public default Optional<StandardPackageType>

Returns:

the type of this package as StandardPackageType type
asStandardPackageType
()

Gets the type of this package as StandardPackageType type or an empty Optional instance if the return value of type() call is not an instance of StandardPackageType type.

public String

Returns:

the description of this package
description
()

Gets the description of this package.

public AppImageLayout

Returns:

the layout of the installed app image of this package
installedPackageLayout
()

Gets the layout of the installed app image of this package.

public default boolean

Returns:

true if the application of this package is Java runtime
isRuntimeInstaller
()

Returns true if the application of this package is Java runtime.

public Optional<Path>

Returns:

the path to a license file of this package
licenseFile
()

Gets the path to a license file of this package if available or an empty Optional instance otherwise.

public default String

Returns:

the name without an extension of the package file of this package
packageFileName
()

Get the name without an extension of the package file of this package.

public default String

Returns:

the full name of the package file of this package
packageFileNameWithSuffix
()

Gets the full name of the package file of this package.

public default Optional<String>

Returns:

the extension of the package file of this package
packageFileSuffix
()

Gets the extension of the package file of this package if available or an empty Optional instance otherwise.

public String

Returns:

the name of the native package of this package
packageName
()

Gets the name of the native package of this package.

public Optional<Path>

Returns:

the path to a directory with the application app image of this package
predefinedAppImage
()

Gets the path to a directory with the predefined app image of this package if available or an empty Optional instance otherwise.

public Path

Returns:

the relative path to the package installation directory of this package
relativeInstallDir
()

Gets the relative path to the package installation directory of this package.

public PackageType

Returns:

the type of this package
type
()

Gets the type of this package.

public String

Returns:

the version of this package
version
()

Gets the version of this package.

Method Detail

aboutURLback to summary
public Optional<String> aboutURL()

Gets the "About" URL of this package if available or an empty Optional instance otherwise.

Returns:Optional<String>

the "About" URL of this package

appback to summary
public Application app()

Gets the application of this package.

Returns:Application

the application of this package

appImageLayoutback to summary
public default AppImageLayout appImageLayout()

Gets the unresolved source app image layout of the application of this package.

Returns:AppImageLayout

the unresolved app image layout of the application of this package

See Also
installedPackageLayout
asApplicationLayoutback to summary
public default Optional<ApplicationLayout> asApplicationLayout()

Returns the unresolved source app image layout of the application of this package as ApplicationLayout type or an empty Optional instance if the layout object is of incompatible type.

Returns an empty Optional instance if isRuntimeInstaller() returns true.

Returns:Optional<ApplicationLayout>

the unresolved source app image layout of the application of this package as ApplicationLayout type

See Also
appImageLayout
asInstalledPackageApplicationLayoutback to summary
public default Optional<ApplicationLayout> asInstalledPackageApplicationLayout()

Returns the layout of the installed app image of this package as ApplicationLayout type or an empty Optional instance if the layout object is of incompatible type.

Returns an empty Optional instance if isRuntimeInstaller() returns true.

Returns:Optional<ApplicationLayout>

the layout of the installed app image of this package as ApplicationLayout type

See Also
installedPackageLayout
asStandardPackageTypeback to summary
public default Optional<StandardPackageType> asStandardPackageType()

Gets the type of this package as StandardPackageType type or an empty Optional instance if the return value of type() call is not an instance of StandardPackageType type.

Returns:Optional<StandardPackageType>

the type of this package as StandardPackageType type

descriptionback to summary
public String description()

Gets the description of this package.

Returns:String

the description of this package

installedPackageLayoutback to summary
public AppImageLayout installedPackageLayout()

Gets the layout of the installed app image of this package.

Returns:AppImageLayout

the layout of the installed app image of this package

See Also
appImageLayout
isRuntimeInstallerback to summary
public default boolean isRuntimeInstaller()

Returns true if the application of this package is Java runtime.

Returns:boolean

true if the application of this package is Java runtime

See Also
Application#isRuntime()
licenseFileback to summary
public Optional<Path> licenseFile()

Gets the path to a license file of this package if available or an empty Optional instance otherwise.

Returns:Optional<Path>

the path to a license file of this package

packageFileNameback to summary
public default String packageFileName()

Get the name without an extension of the package file of this package.

Returns:String

the name without an extension of the package file of this package

packageFileNameWithSuffixback to summary
public default String packageFileNameWithSuffix()

Gets the full name of the package file of this package. The full name consists of the name and the extension.

Returns:String

the full name of the package file of this package

packageFileSuffixback to summary
public default Optional<String> packageFileSuffix()

Gets the extension of the package file of this package if available or an empty Optional instance otherwise.

Returns:Optional<String>

the extension of the package file of this package

packageNameback to summary
public String packageName()

Gets the name of the native package of this package.

The value is a valid file system name and can be safely used to name files/directories in the file system.

Returns:String

the name of the native package of this package

predefinedAppImageback to summary
public Optional<Path> predefinedAppImage()

Gets the path to a directory with the predefined app image of this package if available or an empty Optional instance otherwise.

If isRuntimeInstaller() returns true, the method returns the path to a directory with the predefined runtime. The layout of this directory should be of RuntimeLayout type.

If isRuntimeInstaller() returns false, the method returns the path to a directory with the predefined application image. The layout of this directory should be of ApplicationLayout type.

Returns:Optional<Path>

the path to a directory with the application app image of this package

relativeInstallDirback to summary
public Path relativeInstallDir()

Gets the relative path to the package installation directory of this package. On Windows it is relative to the program files directory ("%ProgramFiles%") and to the system root ("/") on other platforms.

Returns:Path

the relative path to the package installation directory of this package

typeback to summary
public PackageType type()

Gets the type of this package.

Returns:PackageType

the type of this package

versionback to summary
public String version()

Gets the version of this package.

Returns:String

the version of this package

jdk.jpackage.internal.model back to summary

public final Record Package.Stub

extends Record
implements Package
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.model.Package, jdk.jpackage.internal.model.BundleSpec
Record Components
app:Application 
type:PackageType 
packageName:String 
description:String 
version:String 
aboutURL:Optional<String> 
licenseFile:Optional<Path> 
predefinedAppImage:Optional<Path> 
installedPackageLayout:AppImageLayout 
relativeInstallDir:Path 

Default implementation of Package interface.

Field Summary

Modifier and TypeField and Description
private final Optional<String>
aboutURL

Record Component accessed by aboutURL().

private final Application
app

Record Component accessed by app().

private final String
description

Record Component accessed by description().

private final AppImageLayout
installedPackageLayout

Record Component accessed by installedPackageLayout().

private final Optional<Path>
licenseFile

Record Component accessed by licenseFile().

private final String
packageName

Record Component accessed by packageName().

private final Optional<Path>
predefinedAppImage

Record Component accessed by predefinedAppImage().

private final Path
relativeInstallDir

Record Component accessed by relativeInstallDir().

private final PackageType
type

Record Component accessed by type().

private final String
version

Record Component accessed by version().

Constructor Summary

AccessConstructor and Description
public
Stub(Application app, PackageType type, String packageName, String description, String version, Optional<String> aboutURL, Optional<Path> licenseFile, Optional<Path> predefinedAppImage, AppImageLayout installedPackageLayout, Path relativeInstallDir)

Method Summary

Modifier and TypeMethod and Description
public Optional<String>
aboutURL()

Record Component getter of aboutURL.

Implements jdk.jpackage.internal.model.Package.aboutURL.

Gets the "About" URL of this package if available or an empty Optional instance otherwise.

public Application
app()

Record Component getter of app.

Implements jdk.jpackage.internal.model.Package.app.

Gets the application of this package.

public String
description()

Record Component getter of description.

Implements jdk.jpackage.internal.model.Package.description.

Gets the description of this package.

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
installedPackageLayout()

Record Component getter of installedPackageLayout.

Implements jdk.jpackage.internal.model.Package.installedPackageLayout.

Gets the layout of the installed app image of this package.

public Optional<Path>
licenseFile()

Record Component getter of licenseFile.

Implements jdk.jpackage.internal.model.Package.licenseFile.

Gets the path to a license file of this package if available or an empty Optional instance otherwise.

public String
packageName()

Record Component getter of packageName.

Implements jdk.jpackage.internal.model.Package.packageName.

Gets the name of the native package of this package.

public Optional<Path>
predefinedAppImage()

Record Component getter of predefinedAppImage.

Implements jdk.jpackage.internal.model.Package.predefinedAppImage.

Gets the path to a directory with the predefined app image of this package if available or an empty Optional instance otherwise.

public Path
relativeInstallDir()

Record Component getter of relativeInstallDir.

Implements jdk.jpackage.internal.model.Package.relativeInstallDir.

Gets the relative path to the package installation directory of this package.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public PackageType
type()

Record Component getter of type.

Implements jdk.jpackage.internal.model.Package.type.

Gets the type of this package.

public String
version()

Record Component getter of version.

Implements jdk.jpackage.internal.model.Package.version.

Gets the version of this package.

Field Detail

aboutURLback to summary
private final Optional<String> aboutURL

Record Component accessed by aboutURL().

appback to summary
private final Application app

Record Component accessed by app().

descriptionback to summary
private final String description

Record Component accessed by description().

installedPackageLayoutback to summary
private final AppImageLayout installedPackageLayout

Record Component accessed by installedPackageLayout().

licenseFileback to summary
private final Optional<Path> licenseFile

Record Component accessed by licenseFile().

packageNameback to summary
private final String packageName

Record Component accessed by packageName().

predefinedAppImageback to summary
private final Optional<Path> predefinedAppImage

Record Component accessed by predefinedAppImage().

relativeInstallDirback to summary
private final Path relativeInstallDir

Record Component accessed by relativeInstallDir().

typeback to summary
private final PackageType type

Record Component accessed by type().

versionback to summary
private final String version

Record Component accessed by version().

Constructor Detail

Stubback to summary
public Stub(Application app, PackageType type, String packageName, String description, String version, Optional<String> aboutURL, Optional<Path> licenseFile, Optional<Path> predefinedAppImage, AppImageLayout installedPackageLayout, Path relativeInstallDir)

Method Detail

aboutURLback to summary
public Optional<String> aboutURL()

Record Component getter of aboutURL.

Implements jdk.jpackage.internal.model.Package.aboutURL.

Doc from jdk.jpackage.internal.model.Package.aboutURL.

Gets the "About" URL of this package if available or an empty Optional instance otherwise.

appback to summary
public Application app()

Record Component getter of app.

Implements jdk.jpackage.internal.model.Package.app.

Doc from jdk.jpackage.internal.model.Package.app.

Gets the application of this package.

descriptionback to summary
public String description()

Record Component getter of description.

Implements jdk.jpackage.internal.model.Package.description.

Doc from jdk.jpackage.internal.model.Package.description.

Gets the description of this package.

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.

installedPackageLayoutback to summary
public AppImageLayout installedPackageLayout()

Record Component getter of installedPackageLayout.

Implements jdk.jpackage.internal.model.Package.installedPackageLayout.

Doc from jdk.jpackage.internal.model.Package.installedPackageLayout.

Gets the layout of the installed app image of this package.

licenseFileback to summary
public Optional<Path> licenseFile()

Record Component getter of licenseFile.

Implements jdk.jpackage.internal.model.Package.licenseFile.

Doc from jdk.jpackage.internal.model.Package.licenseFile.

Gets the path to a license file of this package if available or an empty Optional instance otherwise.

packageNameback to summary
public String packageName()

Record Component getter of packageName.

Implements jdk.jpackage.internal.model.Package.packageName.

Doc from jdk.jpackage.internal.model.Package.packageName.

Gets the name of the native package of this package.

The value is a valid file system name and can be safely used to name files/directories in the file system.

predefinedAppImageback to summary
public Optional<Path> predefinedAppImage()

Record Component getter of predefinedAppImage.

Implements jdk.jpackage.internal.model.Package.predefinedAppImage.

Doc from jdk.jpackage.internal.model.Package.predefinedAppImage.

Gets the path to a directory with the predefined app image of this package if available or an empty Optional instance otherwise.

If isRuntimeInstaller() returns true, the method returns the path to a directory with the predefined runtime. The layout of this directory should be of RuntimeLayout type.

If isRuntimeInstaller() returns false, the method returns the path to a directory with the predefined application image. The layout of this directory should be of ApplicationLayout type.

relativeInstallDirback to summary
public Path relativeInstallDir()

Record Component getter of relativeInstallDir.

Implements jdk.jpackage.internal.model.Package.relativeInstallDir.

Doc from jdk.jpackage.internal.model.Package.relativeInstallDir.

Gets the relative path to the package installation directory of this package. On Windows it is relative to the program files directory ("%ProgramFiles%") and to the system root ("/") on other platforms.

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.

typeback to summary
public PackageType type()

Record Component getter of type.

Implements jdk.jpackage.internal.model.Package.type.

Doc from jdk.jpackage.internal.model.Package.type.

Gets the type of this package.

versionback to summary
public String version()

Record Component getter of version.

Implements jdk.jpackage.internal.model.Package.version.

Doc from jdk.jpackage.internal.model.Package.version.

Gets the version of this package.