@PublicApi
public interface EnvironmentVariableAccessor
ProcessService
.Modifier and Type | Field and Description |
---|---|
static int |
MAX_SAFE_ENVIRONMENT_LENGTH |
static int |
MAX_SAFE_INDIVIDUAL_VARIABLE_LENGTH |
Modifier and Type | Method and Description |
---|---|
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
|
static final int MAX_SAFE_ENVIRONMENT_LENGTH
static final int MAX_SAFE_INDIVIDUAL_VARIABLE_LENGTH
@NotNull Map<String,String> getEnvironment(@NotNull CommonTaskContext taskContext)
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)taskContext
- TaskContext
object@NotNull List<String> getPaths(@NotNull CommonTaskContext taskContext)
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)taskContext
- TaskContext
object@NotNull String joinEnvironmentVariables(@NotNull Map<String,String> environmentVariables)
environmentVariables
- Map of key-value pairs to be concatenated@NotNull String joinEnvironmentVariables(@NotNull Iterable<Map.Entry<String,String>> environmentVariables)
environmentVariables
- Map.Entry iterable of key-value pairs to be concatenated@NotNull Map<String,String> splitEnvironmentAssignments(@NotNull String environmentAssignments, boolean processBackslashes)
environmentAssignments
- the string containing KEY=VALUE assignments separated with white charactersprocessBackslashes
- whether to treat a backslash as an ordinary or quoting character@NotNull Map<String,String> splitEnvironmentAssignments(@NotNull String environmentAssignments)
environmentAssignments
- string containing KEY=VALUE assignments separated with white charactersvoid validateEnvironmentVariables(@NotNull Map<String,String> environmentVariables)
environmentVariables
- Map.Entry iterable of key-value pairs to be concatenatedvoid validateEnvironmentVariables(@NotNull Iterable<Map.Entry<String,String>> environmentVariables)
environmentVariables
- Map.Entry iterable of key-value pairs to be concatenatedCopyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.