Package jetbrains.buildServer.tools
Class ServerToolProviderAdapter
- java.lang.Object
-
- jetbrains.buildServer.tools.ServerToolProviderAdapter
-
- All Implemented Interfaces:
TeamCityExtension
,ServerToolProvider
- Direct Known Subclasses:
CustomArchiveServerToolProvider
,DirectoryServerToolProvider
public abstract class ServerToolProviderAdapter extends Object implements ServerToolProvider
Created by Evgeniy.Koshkin on 09-Mar-16.
-
-
Constructor Summary
Constructors Constructor Description ServerToolProviderAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description File
fetchToolPackage(ToolVersion toolVersion, File targetDirectory)
Fetch tool package version to the targetDirectory.Collection<? extends ToolVersion>
getAvailableToolVersions()
Collection<InstalledToolVersion>
getBundledToolVersions()
Get collection of bundled tool versions which are included into the TeamCity distribution.String
getDefaultBundledVersionId()
Get id of bundled version which should be used as default if default version is not specified explicitly.Collection<? extends ToolVersion>
getDownloadableBundledToolVersions()
Get a collection of bundled tool versions which are NOT included into the TeamCity disctibution and downloaded and installed after the first TeamCity server startup.String
normalizeToolPackageName(String toolPackageName)
GetPackageVersionResult
tryGetPackageVersion(File toolPackage)
Retrieve tool version if given package has valid tool package format.void
unpackToolPackage(File toolPackage, File targetDirectory)
Unpack valid tool package to the target directory.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.tools.ServerToolProvider
getType
-
-
-
-
Method Detail
-
getAvailableToolVersions
@NotNull public Collection<? extends ToolVersion> getAvailableToolVersions()
- Specified by:
getAvailableToolVersions
in interfaceServerToolProvider
-
tryGetPackageVersion
@NotNull public GetPackageVersionResult tryGetPackageVersion(@NotNull File toolPackage)
Description copied from interface:ServerToolProvider
Retrieve tool version if given package has valid tool package format.- Specified by:
tryGetPackageVersion
in interfaceServerToolProvider
- Parameters:
toolPackage
- Package to inspect.- Returns:
- Version of the tool or
GetPackageVersionResult.error(String)
if package format is unknown / invalid.
-
fetchToolPackage
@NotNull public File fetchToolPackage(@NotNull ToolVersion toolVersion, @NotNull File targetDirectory) throws ToolException
Description copied from interface:ServerToolProvider
Fetch tool package version to the targetDirectory.- Specified by:
fetchToolPackage
in interfaceServerToolProvider
- Returns:
- Path to the fetched file.
- Throws:
ToolException
- if error occurs
-
unpackToolPackage
public void unpackToolPackage(@NotNull File toolPackage, @NotNull File targetDirectory) throws ToolException
Description copied from interface:ServerToolProvider
Unpack valid tool package to the target directory. Form directory layout to use later on the agent.- Specified by:
unpackToolPackage
in interfaceServerToolProvider
- Parameters:
toolPackage
- file with the tool packagetargetDirectory
- existing empty directory- Throws:
ToolException
- if error occurs
-
getBundledToolVersions
@NotNull public Collection<InstalledToolVersion> getBundledToolVersions()
Description copied from interface:ServerToolProvider
Get collection of bundled tool versions which are included into the TeamCity distribution.Note that some bundled tools are downloaded by TeamCity after the server startup. The list of such tools can be obtained via {@link this#getDownloadableBundledToolVersions()}
- Specified by:
getBundledToolVersions
in interfaceServerToolProvider
- Returns:
- Collection of bundled tool versions that are included into the TeamCity distribution.
-
getDownloadableBundledToolVersions
@NotNull public Collection<? extends ToolVersion> getDownloadableBundledToolVersions()
Description copied from interface:ServerToolProvider
Get a collection of bundled tool versions which are NOT included into the TeamCity disctibution and downloaded and installed after the first TeamCity server startup.Important: the implementations should ensure that no network requests or any other IO or CPU intensive operations are made. These versions should be cached and returned instantly.
- Specified by:
getDownloadableBundledToolVersions
in interfaceServerToolProvider
- Returns:
- A collection of downloadable bundled tool versions wich are not included into the TeamCity distribution.
-
getDefaultBundledVersionId
@Nullable public String getDefaultBundledVersionId()
Description copied from interface:ServerToolProvider
Get id of bundled version which should be used as default if default version is not specified explicitly.- Specified by:
getDefaultBundledVersionId
in interfaceServerToolProvider
- Returns:
- Default version id from set of bundled versions if exists or Null to use latest bundled version.
-
normalizeToolPackageName
@NotNull public String normalizeToolPackageName(@NotNull String toolPackageName)
- Specified by:
normalizeToolPackageName
in interfaceServerToolProvider
-
-