Package jetbrains.buildServer.tools.impl
Class DirectoryServerToolProvider
- java.lang.Object
-
- jetbrains.buildServer.tools.ServerToolProviderAdapter
-
- jetbrains.buildServer.tools.impl.DirectoryServerToolProvider
-
- All Implemented Interfaces:
TeamCityExtension
,ServerToolProvider
,PositionAware
,PositionConstraintAware
public class DirectoryServerToolProvider extends ServerToolProviderAdapter implements PositionAware
Created by Evgeniy.Koshkin.
-
-
Constructor Summary
Constructors Constructor Description DirectoryServerToolProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PositionConstraint
getConstraint()
Constraint to be respected during objects sorting.String
getOrderId()
Returns object id that can be referenced by {PositionConstraint
}ToolType
getType()
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 jetbrains.buildServer.tools.ServerToolProviderAdapter
fetchToolPackage, getAvailableToolVersions, getBundledToolVersions, getDefaultBundledVersionId, getDownloadableBundledToolVersions, normalizeToolPackageName
-
-
-
-
Method Detail
-
getType
@NotNull public ToolType getType()
- Specified by:
getType
in interfaceServerToolProvider
-
getOrderId
@NotNull public String getOrderId()
Description copied from interface:PositionAware
Returns object id that can be referenced by {PositionConstraint
}- Specified by:
getOrderId
in interfacePositionAware
- Returns:
- object id
-
getConstraint
@NotNull public PositionConstraint getConstraint()
Description copied from interface:PositionConstraintAware
Constraint to be respected during objects sorting.- Specified by:
getConstraint
in interfacePositionConstraintAware
- Returns:
- position constraint
-
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
- Overrides:
tryGetPackageVersion
in classServerToolProviderAdapter
- Parameters:
toolPackage
- Package to inspect.- Returns:
- Version of the tool or
GetPackageVersionResult.error(String)
if package format is unknown / invalid.
-
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
- Overrides:
unpackToolPackage
in classServerToolProviderAdapter
- Parameters:
toolPackage
- file with the tool packagetargetDirectory
- existing empty directory- Throws:
ToolException
- if error occurs
-
-