public abstract class DownloadFromUrlInstaller extends ToolInstaller
ToolInstaller
that just downloads
an archive from the URL and extracts it.
Each instance of this is configured to download from a specific URL identified by an ID.
Modifier and Type | Class and Description |
---|---|
static class |
DownloadFromUrlInstaller.DescriptorImpl<T extends DownloadFromUrlInstaller> |
static class |
DownloadFromUrlInstaller.Installable
Downloadable and installable tool.
|
static class |
DownloadFromUrlInstaller.InstallableList
Used for JSON databinding to parse the obtained list.
|
class |
DownloadFromUrlInstaller.NodeSpecificInstallable
Convenient abstract class to implement a NodeSpecificInstallable based on an existing Installable
|
ToolInstaller.ToolInstallerEntry, ToolInstaller.ToolInstallerList
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
String |
id |
tool
Modifier | Constructor and Description |
---|---|
protected |
DownloadFromUrlInstaller(String id) |
Modifier and Type | Method and Description |
---|---|
protected FilePath |
findPullUpDirectory(FilePath root)
Often an archive contains an extra top-level directory that's unnecessary when extracted on the disk
into the expected location.
|
DownloadFromUrlInstaller.Installable |
getInstallable()
Gets the
DownloadFromUrlInstaller.Installable identified by id . |
protected boolean |
isUpToDate(FilePath expectedLocation,
DownloadFromUrlInstaller.Installable i)
Checks if the specified expected location already contains the installed version of the tool.
|
FilePath |
performInstallation(ToolInstallation tool,
Node node,
TaskListener log)
Ensure that the configured tool is really installed.
|
appliesTo, getDescriptor, getLabel, preferredLocation, setTool
public final String id
protected DownloadFromUrlInstaller(String id)
protected boolean isUpToDate(FilePath expectedLocation, DownloadFromUrlInstaller.Installable i) throws IOException, InterruptedException
DownloadFromUrlInstaller.Installable
,
based on the assumption that released bits do not change its content.IOException
InterruptedException
public DownloadFromUrlInstaller.Installable getInstallable() throws IOException
DownloadFromUrlInstaller.Installable
identified by id
.IOException
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException
ToolInstaller
ToolInstaller.appliesTo(Node)
are true.performInstallation
in class ToolInstaller
tool
- the tool being installednode
- the computer on which to install the toollog
- any status messages produced by the installation go hereToolInstaller.preferredLocation(hudson.tools.ToolInstallation, hudson.model.Node)
IOException
- if installation failsInterruptedException
- if communication with a agent is interruptedprotected FilePath findPullUpDirectory(FilePath root) throws IOException, InterruptedException
The caller will "pull up" the discovered real root by throw away the intermediate directory, so that the user-configured "tool home" directory contains the right files.
The default implementation applies some heuristics to auto-determine if the pull up is necessary. This should work for typical archive files.
root
- The directory that contains the extracted archive. This directory contains nothing but the
extracted archive. For example, if the user installed
http://archive.apache.org/dist/ant/binaries/jakarta-ant-1.1.zip , this directory would contain
a single directory "jakarta-ant".root
that contains the meat. In the above example,
root.child("jakarta-ant")
should be returned. If there's no directory to pull up,
return null.IOException
InterruptedException
Copyright © 2004–2021. All rights reserved.