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 FilefetchToolPackage(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.StringgetDefaultBundledVersionId()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.StringnormalizeToolPackageName(String toolPackageName)GetPackageVersionResulttryGetPackageVersion(File toolPackage)Retrieve tool version if given package has valid tool package format.voidunpackToolPackage(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:
getAvailableToolVersionsin interfaceServerToolProvider
-
tryGetPackageVersion
@NotNull public GetPackageVersionResult tryGetPackageVersion(@NotNull File toolPackage)
Description copied from interface:ServerToolProviderRetrieve tool version if given package has valid tool package format.- Specified by:
tryGetPackageVersionin 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:ServerToolProviderFetch tool package version to the targetDirectory.- Specified by:
fetchToolPackagein interfaceServerToolProvider- Returns:
- Path to the fetched file.
- Throws:
ToolException- if error occurs
-
unpackToolPackage
public void unpackToolPackage(@NotNull File toolPackage, @NotNull File targetDirectory) throws ToolExceptionDescription copied from interface:ServerToolProviderUnpack valid tool package to the target directory. Form directory layout to use later on the agent.- Specified by:
unpackToolPackagein 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:ServerToolProviderGet 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:
getBundledToolVersionsin 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:ServerToolProviderGet 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:
getDownloadableBundledToolVersionsin 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:ServerToolProviderGet id of bundled version which should be used as default if default version is not specified explicitly.- Specified by:
getDefaultBundledVersionIdin 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:
normalizeToolPackageNamein interfaceServerToolProvider
-
-