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
AToolInstaller
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthenticatedZipExtractionInstaller.DescriptorImpl
Descriptor for theAuthenticatedZipExtractionInstaller
.-
Nested classes/interfaces inherited from class hudson.tools.ToolInstaller
ToolInstaller.ToolInstallerEntry, ToolInstaller.ToolInstallerList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.tools.ToolInstaller
tool
-
-
Constructor Summary
Constructors Constructor Description AuthenticatedZipExtractionInstaller(String label)
Constructor that sets mandatory fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Date
downloadOnFromMaster(URI uri, Long timestampOfLocalContents, String usernameOrNull, String passwordOrNull, FilePath dir, TaskListener logOrNull, String nodeName)
protected Date
downloadOnRemoteNode(URI uri, Long timestampOfLocalContents, String usernameOrNull, String passwordOrNull, FilePath dir, TaskListener logOrNull, String nodeName)
String
getCredentialsId()
ID of the credentials to use when doing the download.String
getSubdir()
Subdirectory within the zip/tar.gz where the tool's binaries are located.String
getUrl()
URL of a zip/tar.gz file which should be downloaded and unpacked if the tool is missing or out of date.boolean
isFallbackToExistingInstallation()
protected com.cloudbees.plugins.credentials.common.StandardCredentials
lookupConfiguredCredentials(String urlHostOrNullOrEmpty)
FilePath
performInstallation(ToolInstallation tool, Node node, TaskListener log)
void
setCredentialsId(String credentialsId)
SetsgetCredentialsId()
.void
setFallbackToExistingInstallation(boolean fallbackToExistingInstallation)
void
setSubdir(String subdir)
SetsgetSubdir()
.void
setUrl(String url)
SetsgetUrl()
.-
Methods inherited from class hudson.tools.ToolInstaller
appliesTo, getDescriptor, getLabel, preferredLocation, setTool
-
-
-
-
Constructor Detail
-
AuthenticatedZipExtractionInstaller
@DataBoundConstructor public AuthenticatedZipExtractionInstaller(String label)
Constructor that sets mandatory fields.- Parameters:
label
- TheToolInstaller.getLabel()
.
-
-
Method Detail
-
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)
SetsgetUrl()
.- 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)
SetsgetCredentialsId()
.- 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)
SetsgetSubdir()
.- 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 classToolInstaller
- 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
-
-