Interface Package

All Known Subinterfaces:
LinuxDebPackage, LinuxPackage, LinuxRpmPackage, MacDmgPackage, MacPackage, MacPkgPackage, WinExePackage, WinMsiPackage
All Known Implementing Classes:
Package.Stub

public interface Package
Native application package. The interface specifies the source app image layout with two transformations: package app image layout and installed app image layout.

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
  • Method Details

    • app

      Gets the application of this package.
      Returns:
      the application of this package
    • type

      PackageType type()
      Gets the type of this package.
      Returns:
      the type of this package
    • asStandardPackageType

      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:
      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

      String description()
      Gets the description of this package.
      Returns:
      the description of this package
    • version

      String version()
      Gets the version of this package.
      Returns:
      the version of this package
    • aboutURL

      Optional<String> aboutURL()
      Gets the "About" URL of this package if available or an empty Optional instance otherwise.
      Returns:
      the "About" URL of this package
    • licenseFile

      Optional<Path> licenseFile()
      Gets the path to a license file of this package if available or an empty Optional instance otherwise.
      Returns:
      the path to a license file of this package
    • predefinedAppImage

      Optional<Path> predefinedAppImage()
      Gets the path to a directory with the application app image of this package if available or an empty Optional instance otherwise.
      Returns:
      the path to a directory with the application app image of this package
    • appImageLayout

      default AppImageLayout 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

      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:
      the unresolved source app image layout of the application of this package as ApplicationLayout type
      See Also:
    • packageLayout

      default AppImageLayout 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

      default Optional<ApplicationLayout> asPackageApplicationLayout()
      Returns the layout of the installed app image of the application resolved at the relative installation directory 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:
      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

      default AppImageLayout 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

      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:
      the layout of the installed app image of this package as ApplicationLayout type
      See Also:
    • packageFileName

      default String 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

      default Optional<String> packageFileSuffix()
      Gets the extension of the package file of this package if available or an empty Optional instance otherwise.
      Returns:
      the extension of the package file of this package
    • packageFileNameWithSuffix

      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:
      the full name of the package file of this package
    • isRuntimeInstaller

      default boolean isRuntimeInstaller()
      Returns true 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