Interface Package
- All Known Subinterfaces:
LinuxDebPackage
,LinuxPackage
,LinuxRpmPackage
,MacDmgPackage
,MacPackage
,MacPkgPackage
,WinExePackage
,WinMsiPackage
- All Known Implementing Classes:
Package.Stub
Use appImageLayout()
or asApplicationLayout()
to get the
unresolved source app image layout.
Package app image layout is the source app image layout resolved at the relative installation directory of the package. Additionally, to resolve the source layout, some packages may transform the source layout.
Use packageLayout()
or asPackageApplicationLayout()
to get
the package 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 | Package app image layout | Installed app image layout | |
---|---|---|---|
Windows | bin/foo.exe app/foo.jar | Duke/bin/foo.exe Duke/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 | /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 | /Applications/Duke.app/Contents/MacOS/foo /Applications/Duke.app/Contents/app/foo.jar |
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
Default implementation ofPackage
interface. -
Method Summary
Modifier and TypeMethodDescriptionaboutURL()
Gets the "About" URL of this package if available or an emptyOptional
instance otherwise.app()
Gets the application of this package.default AppImageLayout
Gets the unresolved source app image layout of the application of this package.default Optional
<ApplicationLayout> Returns the unresolved source app image layout of the application of this package asApplicationLayout
type or an emptyOptional
instance if the layout object is of incompatible type.default Optional
<ApplicationLayout> Returns the layout of the installed app image of this package asApplicationLayout
type or an emptyOptional
instance if the layout object is of incompatible type.default Optional
<ApplicationLayout> Returns the layout of the installed app image of the application resolved at the relative installation directory of this package asApplicationLayout
type or an emptyOptional
instance if the layout object is of incompatible type.default Optional
<StandardPackageType> Gets the type of this package asStandardPackageType
type or an emptyOptional
instance if the return value oftype()
call is not an instance ofStandardPackageType
type.Gets the description of this package.default AppImageLayout
Gets the layout of the installed app image of this package.default boolean
Returnstrue
if the application of this package is Java runtime.Gets the path to a license file of this package if available or an emptyOptional
instance otherwise.default String
Get the name without an extension of the package file of this package.default String
Gets the full name of the package file of this package.Gets the extension of the package file of this package if available or an emptyOptional
instance otherwise.default AppImageLayout
Gets the layout of the installed app image of the application resolved at the relative installation directory of this package.Gets the name of the native package of this package.Gets the path to a directory with the application app image of this package if available or an emptyOptional
instance otherwise.Gets the relative path to the package installation directory of this package.type()
Gets the type of this package.version()
Gets the version of this package.
-
Method Details
-
app
-
type
-
asStandardPackageType
Gets the type of this package asStandardPackageType
type or an emptyOptional
instance if the return value oftype()
call is not an instance ofStandardPackageType
type.- Returns:
- the type of this package as
StandardPackageType
type
-
packageName
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:
- the name of the native package of this package
-
description
-
version
-
aboutURL
-
licenseFile
-
predefinedAppImage
-
appImageLayout
Gets the unresolved source app image layout of the application of this package.- Returns:
- the unresolved app image layout of the application of this package
- See Also:
-
asApplicationLayout
Returns the unresolved source app image layout of the application of this package asApplicationLayout
type or an emptyOptional
instance if the layout object is of incompatible type.Returns an empty
Optional
instance ifisRuntimeInstaller()
returnstrue
.- Returns:
- the unresolved source app image layout of the application of this
package as
ApplicationLayout
type - See Also:
-
packageLayout
Gets the layout of the installed app image of the application resolved at the relative installation directory of this package.- Returns:
- the layout of the installed app image of the application resolved at the relative installation directory of this package
- See Also:
-
asPackageApplicationLayout
Returns the layout of the installed app image of the application resolved at the relative installation directory of this package asApplicationLayout
type or an emptyOptional
instance if the layout object is of incompatible type.Returns an empty
Optional
instance ifisRuntimeInstaller()
returnstrue
.- Returns:
- the layout of the installed app image of the application resolved at
the relative installation directory of this package as
ApplicationLayout
type - See Also:
-
installedPackageLayout
Gets the layout of the installed app image of this package.- Returns:
- the layout of the installed app image of this package
- See Also:
-
asInstalledPackageApplicationLayout
Returns the layout of the installed app image of this package asApplicationLayout
type or an emptyOptional
instance if the layout object is of incompatible type.Returns an empty
Optional
instance ifisRuntimeInstaller()
returnstrue
.- Returns:
- the layout of the installed app image of this package as
ApplicationLayout
type - See Also:
-
packageFileName
Get the name without an extension of the package file of this package.- Returns:
- the name without an extension of the package file of this package
-
packageFileSuffix
-
packageFileNameWithSuffix
Gets the full name of the package file of this package. The full name consists of the name and the extension.- Returns:
- the full name of the package file of this package
-
isRuntimeInstaller
default boolean isRuntimeInstaller()Returnstrue
if the application of this package is Java runtime.- Returns:
true
if the application of this package is Java runtime- See Also:
-
relativeInstallDir
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:
- the relative path to the package installation directory of this package
-