Interface JdkProvider


  • public interface JdkProvider
    Entry point for the JDK provider. Add a text file named META-INF/services/com.install4j.jdk.spi.JdkProvider to the JAR file containing the JDK provider and put the name of the implementation class in it. If the JAR file is added to the class path of install4j, the JDK provider will be picked up automatically. The class path of install4j can be changed by adding the line
    
     -classpath/a <path to JAR file>
     
    to the bin/install4j.vmoptions file.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default java.lang.String detectDirectoryLayoutPrefix​(java.lang.String platform, java.io.File bundleFile)
      Returns the common prefix directory for the directory layout of the JDK.
      JdkReleaseNode getByConfigKey​(java.lang.String configKey)
      Find a release from the config key.
      default java.lang.String getDisplayName()
      The display name for the provider.
      java.lang.String getId()
      A unique ID for the provider.
      java.util.Collection<? extends JdkNode> getReleases()
      Returns all releases.
      default java.io.File removeArchivePrefix​(java.io.File relativeFile, java.lang.String release, java.lang.String platform)
      Remove a common prefix directory from the relative paths inside a JDK bundle.
    • Method Detail

      • getId

        @NotNull
        java.lang.String getId()
        A unique ID for the provider.
      • getDisplayName

        @NotNull
        default java.lang.String getDisplayName()
        The display name for the provider. By default, this is the same as the ID.
      • getReleases

        @NotNull
        java.util.Collection<? extends JdkNode> getReleases()
        Returns all releases. This is a tree of category and release nodes that is displayed to the user.
        See Also:
        JdkReleaseNode, JdkCategoryNode
      • removeArchivePrefix

        @NotNull
        default java.io.File removeArchivePrefix​(@NotNull
                                                 java.io.File relativeFile,
                                                 java.lang.String release,
                                                 @NotNull
                                                 java.lang.String platform)
        Remove a common prefix directory from the relative paths inside a JDK bundle. By default, nothing is removed.
      • detectDirectoryLayoutPrefix

        @NotNull
        default java.lang.String detectDirectoryLayoutPrefix​(@NotNull
                                                             java.lang.String platform,
                                                             java.io.File bundleFile)
        Returns the common prefix directory for the directory layout of the JDK. By default this handles the Contents/Home/ prefix for JDKs on macOS.