Class EnvStringParseHelper
java.lang.Object
com.synopsys.arc.jenkinsci.plugins.extratoolinstallers.utils.EnvStringParseHelper
Provides parsing of environment variables in input string.
- Since:
- 0.3
- Author:
- Oleg Nenashev
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkStringForMacro
(ToolInstaller installer, String stringName, String macroString) Checks that all variables have been resolved.static String
substituteEnvVars
(String macroString, EnvVars environment) Resolves tools installation directory using global variables.static String
substituteNodeProperty
(String macroString, NodeProperty<?> property) Substitutes string according to node property.static String
substituteNodeVariables
(String macroString, Node node) Substitutes string according to all node properties.
-
Method Details
-
substituteEnvVars
Resolves tools installation directory using global variables.- Parameters:
environment
- Collection of environment variablesmacroString
- Input path with macro calls- Returns:
- Raw string
- Since:
- 0.3
-
substituteNodeVariables
@Nullable public static String substituteNodeVariables(@CheckForNull String macroString, @NonNull Node node) Substitutes string according to all node properties.- Parameters:
macroString
- String to be substitutednode
- Node whose properties provide available substitution- Returns:
- Substituted string
-
substituteNodeProperty
Substitutes string according to node property.- Parameters:
macroString
- String to be substitutedproperty
- Node property- Returns:
- Substituted string
- Since:
- 0.3
-
checkStringForMacro
public static void checkStringForMacro(ToolInstaller installer, String stringName, String macroString) throws ExtraToolInstallersException Checks that all variables have been resolved.- Parameters:
installer
- The installer that's doing the checking.stringName
- The human-friendly name of the string being checked.macroString
- The string contents that should be checked.- Throws:
ExtraToolInstallersException
- String validation failed (there are unresolved variables)- Since:
- 0.3
-