Class AgentBlackListTargetDirRestrictor
- java.lang.Object
-
- jetbrains.buildServer.agent.impl.artifacts.AgentBlackListTargetDirRestrictor
-
- All Implemented Interfaces:
ArtifactDependencyTargetDirRestrictor
,ArtifactDependencyTargetDirectoryCleaner
,TeamCityExtension
public class AgentBlackListTargetDirRestrictor extends Object implements ArtifactDependencyTargetDirRestrictor, ArtifactDependencyTargetDirectoryCleaner, TeamCityExtension
ArtifactDependencyTargetDirRestrictor restricting download by black and white lists. Every download that is inside black list and not inside white list will be rejected.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AgentBlackListTargetDirRestrictor.ParametersRestrictorItem
static interface
AgentBlackListTargetDirRestrictor.RestrictorItem
static class
AgentBlackListTargetDirRestrictor.StaticRestrictorItem
-
Field Summary
Fields Modifier and Type Field Description static String
ALLOWED_LIST_PARAMETER_KEY
static String
BANNED_LIST_PARAMETER_KEY
static String
BLACK_LIST_PARAMETER_KEY
static String
WHITE_LIST_PARAMETER_KEY
-
Constructor Summary
Constructors Constructor Description AgentBlackListTargetDirRestrictor(Collection<AgentBlackListTargetDirRestrictor.RestrictorItem> blackList, Collection<AgentBlackListTargetDirRestrictor.RestrictorItem> whiteList)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
cleanDirectory(File directory)
static AgentBlackListTargetDirRestrictor
createFromAgentConfiguration(BuildAgentConfiguration agentConfiguration)
Collection<AgentBlackListTargetDirRestrictor.RestrictorItem>
getBlackList()
Collection<AgentBlackListTargetDirRestrictor.RestrictorItem>
getWhiteList()
boolean
isEnabled()
String
tryGetRestrictedReason(ResolverRuntimeConfiguration myConfig, String targetPath)
-
-
-
Field Detail
-
BLACK_LIST_PARAMETER_KEY
public static final String BLACK_LIST_PARAMETER_KEY
- See Also:
- Constant Field Values
-
BANNED_LIST_PARAMETER_KEY
public static final String BANNED_LIST_PARAMETER_KEY
- See Also:
- Constant Field Values
-
WHITE_LIST_PARAMETER_KEY
public static final String WHITE_LIST_PARAMETER_KEY
- See Also:
- Constant Field Values
-
ALLOWED_LIST_PARAMETER_KEY
public static final String ALLOWED_LIST_PARAMETER_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AgentBlackListTargetDirRestrictor
public AgentBlackListTargetDirRestrictor(@NotNull Collection<AgentBlackListTargetDirRestrictor.RestrictorItem> blackList, @NotNull Collection<AgentBlackListTargetDirRestrictor.RestrictorItem> whiteList)
-
-
Method Detail
-
createFromAgentConfiguration
@NotNull @Contract("_ -> new") public static AgentBlackListTargetDirRestrictor createFromAgentConfiguration(@NotNull BuildAgentConfiguration agentConfiguration)
-
tryGetRestrictedReason
public String tryGetRestrictedReason(@NotNull ResolverRuntimeConfiguration myConfig, @NotNull String targetPath) throws IOException
- Specified by:
tryGetRestrictedReason
in interfaceArtifactDependencyTargetDirRestrictor
- Parameters:
myConfig
- ResolverRuntimeConfiguration instancetargetPath
- Target directory real (absolute and resolved including links) path- Returns:
- reason why downloading artifact to the target directory is restricted or null if is not restricted
- Throws:
IOException
- any unhandled exception will interrupt artifact dependency download with default reason
-
cleanDirectory
@Nullable public String cleanDirectory(@NotNull File directory)
- Specified by:
cleanDirectory
in interfaceArtifactDependencyTargetDirectoryCleaner
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceArtifactDependencyTargetDirectoryCleaner
-
getBlackList
@NotNull public Collection<AgentBlackListTargetDirRestrictor.RestrictorItem> getBlackList()
-
getWhiteList
@NotNull public Collection<AgentBlackListTargetDirRestrictor.RestrictorItem> getWhiteList()
-
-