public class EnvironmentVariableAccessorImpl extends Object implements EnvironmentVariableAccessor
MAX_SAFE_ENVIRONMENT_LENGTH, MAX_SAFE_INDIVIDUAL_VARIABLE_LENGTH
Constructor and Description |
---|
EnvironmentVariableAccessorImpl(CapabilityContext capabilityContext,
CustomVariableContext customVariableContext) |
Modifier and Type | Method and Description |
---|---|
static String |
forceLegalIdentifier(String key) |
Map<String,String> |
getEnvironment() |
Map<String,String> |
getEnvironment(CommonTaskContext taskContext)
Use
TaskContext as a source of environment settings. |
List<String> |
getPaths(CommonTaskContext taskContext)
Use
TaskContext as a source of additional PATH settings. |
String |
joinEnvironmentVariables(Iterable<Map.Entry<String,String>> environmentVariables)
Concatenate environment variables into string.
|
String |
joinEnvironmentVariables(Map<String,String> environmentVariables)
Concatenate environment variables into string.
|
Map<String,String> |
splitEnvironmentAssignments(String environmentAssignments)
Splits "Environment settings" string into array of separate strings.
|
Map<String,String> |
splitEnvironmentAssignments(String environmentAssignments,
boolean processBackslashes)
Splits "Environment settings" string into array of separate strings.
|
void |
validateEnvironmentVariables(Iterable<Map.Entry<String,String>> environmentVariables)
Perform basic validation of environment settings before passing it to process-utils
|
void |
validateEnvironmentVariables(Map<String,String> environmentVariables)
Perform basic validation of environment settings before passing it to process-utils
|
public EnvironmentVariableAccessorImpl(CapabilityContext capabilityContext, CustomVariableContext customVariableContext)
@NotNull public Map<String,String> getEnvironment()
getEnvironment
in interface EnvironmentVariableAccessor
@NotNull public Map<String,String> getEnvironment(@NotNull CommonTaskContext taskContext)
EnvironmentVariableAccessor
TaskContext
as a source of environment settings. The following variables will be returned
- variables for variable definitions from taskContext
- JAVA_HOME (if defined in task configuration and appropriate capability exists)getEnvironment
in interface EnvironmentVariableAccessor
taskContext
- TaskContext
object@NotNull public List<String> getPaths(@NotNull CommonTaskContext taskContext)
EnvironmentVariableAccessor
TaskContext
as a source of additional PATH settings. The following values might be returned
- $JAVA_HOME/bin (if defined in task configuration and appropriate capability exists)getPaths
in interface EnvironmentVariableAccessor
taskContext
- TaskContext
object@NotNull public String joinEnvironmentVariables(@NotNull Map<String,String> environmentVariables)
EnvironmentVariableAccessor
joinEnvironmentVariables
in interface EnvironmentVariableAccessor
environmentVariables
- Map of key-value pairs to be concatenated@NotNull public String joinEnvironmentVariables(@NotNull Iterable<Map.Entry<String,String>> environmentVariables)
EnvironmentVariableAccessor
joinEnvironmentVariables
in interface EnvironmentVariableAccessor
environmentVariables
- Map.Entry iterable of key-value pairs to be concatenated@NotNull public Map<String,String> splitEnvironmentAssignments(@NotNull String environmentAssignments, boolean processBackslashes)
EnvironmentVariableAccessor
splitEnvironmentAssignments
in interface EnvironmentVariableAccessor
environmentAssignments
- the string containing KEY=VALUE assignments separated with white charactersprocessBackslashes
- whether to treat a backslash as an ordinary or quoting character@NotNull public Map<String,String> splitEnvironmentAssignments(@NotNull String environmentAssignments)
EnvironmentVariableAccessor
splitEnvironmentAssignments
in interface EnvironmentVariableAccessor
environmentAssignments
- string containing KEY=VALUE assignments separated with white characterspublic void validateEnvironmentVariables(@NotNull Map<String,String> environmentVariables)
EnvironmentVariableAccessor
validateEnvironmentVariables
in interface EnvironmentVariableAccessor
environmentVariables
- Map.Entry iterable of key-value pairs to be concatenatedpublic void validateEnvironmentVariables(@NotNull Iterable<Map.Entry<String,String>> environmentVariables)
EnvironmentVariableAccessor
validateEnvironmentVariables
in interface EnvironmentVariableAccessor
environmentVariables
- Map.Entry iterable of key-value pairs to be concatenatedCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.