@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 |
---|---|
@NotNull Map<String,String> |
getEnvironment() |
@NotNull Map<String,String> |
getEnvironment(@NotNull CommonTaskContext taskContext)
Use
TaskContext as a source of environment settings. |
@NotNull List<String> |
getPaths(@NotNull CommonTaskContext taskContext)
Use
TaskContext as a source of additional PATH settings. |
@NotNull String |
joinEnvironmentVariables(@NotNull Iterable<Map.Entry<String,String>> environmentVariables)
Concatenate environment variables into string.
|
@NotNull String |
joinEnvironmentVariables(@NotNull Map<String,String> environmentVariables)
Concatenate environment variables into string.
|
@NotNull Map<String,String> |
splitEnvironmentAssignments(@NotNull String environmentAssignments)
Splits "Environment settings" string into array of separate strings.
|
@NotNull Map<String,String> |
splitEnvironmentAssignments(@NotNull String environmentAssignments,
boolean processBackslashes)
Splits "Environment settings" string into array of separate strings.
|
void |
validateEnvironmentVariables(@NotNull Iterable<Map.Entry<String,String>> environmentVariables)
Perform basic validation of environment settings before passing it to process-utils
|
void |
validateEnvironmentVariables(@NotNull 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 @NotNull Map<String,String> getEnvironment(@NotNull @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 @NotNull List<String> getPaths(@NotNull @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 @NotNull String joinEnvironmentVariables(@NotNull @NotNull Map<String,String> environmentVariables)
environmentVariables
- Map of key-value pairs to be concatenated@NotNull @NotNull String joinEnvironmentVariables(@NotNull @NotNull Iterable<Map.Entry<String,String>> environmentVariables)
environmentVariables
- Map.Entry iterable of key-value pairs to be concatenated@NotNull @NotNull Map<String,String> splitEnvironmentAssignments(@NotNull @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 @NotNull Map<String,String> splitEnvironmentAssignments(@NotNull @NotNull String environmentAssignments)
environmentAssignments
- string containing KEY=VALUE assignments separated with white charactersvoid validateEnvironmentVariables(@NotNull @NotNull Map<String,String> environmentVariables)
environmentVariables
- Map.Entry iterable of key-value pairs to be concatenatedvoid validateEnvironmentVariables(@NotNull @NotNull Iterable<Map.Entry<String,String>> environmentVariables)
environmentVariables
- Map.Entry iterable of key-value pairs to be concatenatedCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.