Class ExternalProcessBuilder

java.lang.Object
com.atlassian.bamboo.process.ExternalProcessBuilder

@PublicApi public final class ExternalProcessBuilder extends Object
Builder to create ExternalProcesss using the ProcessService
Since:
3.1
  • Constructor Details

    • ExternalProcessBuilder

      public ExternalProcessBuilder()
  • Method Details

    • path

      public ExternalProcessBuilder path(@NotNull @NotNull String path)
    • path

      public ExternalProcessBuilder path(@NotNull @NotNull List<String> path)
    • command

      public ExternalProcessBuilder command(@NotNull @NotNull List<String> command)
    • commandFromString

      public ExternalProcessBuilder commandFromString(@NotNull @NotNull String commandString)
      Splits the given command string into arguments and adds them to the builder
      Parameters:
      commandString - to split into multiple parts and add to the list of commands
      Returns:
      builder
      Since:
      3.1.4
    • env

      public ExternalProcessBuilder env(@NotNull @NotNull Map<String,String> env)
      Adds env variables. If variable name equals SystemProperty.PATH.getKey() the value is appended to the front of existing paths
      Parameters:
      env - key -> value map of environment variables to add
      Returns:
      builder
    • env

      public ExternalProcessBuilder env(@NotNull @NotNull String key, @NotNull @NotNull String value)
      Adds env variable. If variable name equals SystemProperty.PATH.getKey() the value is appended to the front of existing paths.
      Parameters:
      key - name of environment variable
      value - value of environment variable
      Returns:
      builder
    • input

      public ExternalProcessBuilder input(@Nullable @Nullable String input)
      Set the standard input to be passed to the spawned process.
    • workingDirectory

      public ExternalProcessBuilder workingDirectory(@NotNull @NotNull File workingDirectory)
    • runWithPowershell

      public ExternalProcessBuilder runWithPowershell(boolean runWithPowershell)
    • setBackgroundProcess

      public ExternalProcessBuilder setBackgroundProcess(boolean value)
    • getCompletionCallback

      @NotNull public @NotNull Optional<Runnable> getCompletionCallback()
    • setCompletionCallback

      public ExternalProcessBuilder setCompletionCallback(@Nullable @Nullable Runnable completionCallback)
    • isBackgroundProcess

      public boolean isBackgroundProcess()
    • getCommandExecutable

      @Nullable public @Nullable String getCommandExecutable()
    • getPaths

      public List<String> getPaths()
    • getCommand

      public List<String> getCommand()
    • getWorkingDirectory

      public File getWorkingDirectory()
    • getEnv

      public Map<String,String> getEnv()
    • isRunWithPowershell

      public boolean isRunWithPowershell()
    • dockerContainerId

      public ExternalProcessBuilder dockerContainerId(String dockerContainer)
    • getDockerContainerId

      public String getDockerContainerId()
    • isUseWindowsBatFilesForWhitespaceHandling

      public boolean isUseWindowsBatFilesForWhitespaceHandling()
    • setUseWindowsBatFilesForWhitespaceHandling

      public ExternalProcessBuilder setUseWindowsBatFilesForWhitespaceHandling(boolean useWindowsBatFilesForWhitespaceHandling)
    • getInput

      @Nullable public @Nullable String getInput()