Class AuthenticatedZipExtractionInstaller

java.lang.Object
hudson.tools.ToolInstaller
io.jenkins.plugins.extratoolinstallers.installers.AuthenticatedZipExtractionInstaller
All Implemented Interfaces:
ExtensionPoint, Describable<ToolInstaller>

public class AuthenticatedZipExtractionInstaller extends ToolInstaller
A ToolInstaller that downloads a zip or tar.gz and unpacks it in order to install a tool. If the tool is already present, it will only be re-downloaded/re-unpacked if the URL is newer than the existing content. The download supports HTTP basic authentication.
  • Constructor Details

    • AuthenticatedZipExtractionInstaller

      @DataBoundConstructor public AuthenticatedZipExtractionInstaller(String label)
      Constructor that sets mandatory fields.
      Parameters:
      label - The ToolInstaller.getLabel().
  • Method Details

    • getUrl

      @CheckForNull public String getUrl()
      URL of a zip/tar.gz file which should be downloaded and unpacked if the tool is missing or out of date.
      Returns:
      URL, or null if none has been set.
    • setUrl

      @DataBoundSetter public void setUrl(@Nullable String url)
      Sets getUrl().
      Parameters:
      url - New value.
    • getCredentialsId

      @CheckForNull public String getCredentialsId()
      ID of the credentials to use when doing the download.
      Returns:
      The credentials ID, or null if none has been set.
    • setCredentialsId

      @DataBoundSetter public void setCredentialsId(@Nullable String credentialsId)
      Parameters:
      credentialsId - New value.
    • getSubdir

      @CheckForNull public String getSubdir()
      Subdirectory within the zip/tar.gz where the tool's binaries are located. It is this folder that's added to the path (etc). Can be null/empty if the binaries are at the base of the zip/tar.gz.
      Returns:
      The subdirectory, or null if no subdirectory has been set.
    • setSubdir

      @DataBoundSetter public void setSubdir(@Nullable String subdir)
      Parameters:
      subdir - New value.
    • isFallbackToExistingInstallation

      public boolean isFallbackToExistingInstallation()
    • setFallbackToExistingInstallation

      @DataBoundSetter public void setFallbackToExistingInstallation(boolean fallbackToExistingInstallation)
    • performInstallation

      public FilePath performInstallation(@NonNull ToolInstallation tool, @NonNull Node node, @CheckForNull TaskListener log) throws IOException, InterruptedException
      Specified by:
      performInstallation in class ToolInstaller
      Throws:
      IOException
      InterruptedException
    • lookupConfiguredCredentials

      protected com.cloudbees.plugins.credentials.common.StandardCredentials lookupConfiguredCredentials(@CheckForNull String urlHostOrNullOrEmpty) throws ExtraToolInstallersException
      Throws:
      ExtraToolInstallersException
    • downloadOnFromMaster

      protected Date downloadOnFromMaster(@NonNull URI uri, @CheckForNull Long timestampOfLocalContents, @CheckForNull String usernameOrNull, @CheckForNull String passwordOrNull, @NonNull FilePath dir, @CheckForNull TaskListener logOrNull, @NonNull String nodeName) throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • downloadOnRemoteNode

      protected Date downloadOnRemoteNode(@NonNull URI uri, @CheckForNull Long timestampOfLocalContents, @CheckForNull String usernameOrNull, @CheckForNull String passwordOrNull, @NonNull FilePath dir, @CheckForNull TaskListener logOrNull, @NonNull String nodeName) throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException