Class ExternalProcessBuilder


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

      • ExternalProcessBuilder

        public ExternalProcessBuilder()
    • Method Detail

      • 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.
      • getCompletionCallback

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

        public boolean isBackgroundProcess()
      • getCommandExecutable

        @Nullable
        public @Nullable String getCommandExecutable()
      • getWorkingDirectory

        public File getWorkingDirectory()
      • isRunWithPowershell

        public boolean isRunWithPowershell()
      • getDockerContainerId

        public String getDockerContainerId()
      • isUseWindowsBatFilesForWhitespaceHandling

        public boolean isUseWindowsBatFilesForWhitespaceHandling()
      • setUseWindowsBatFilesForWhitespaceHandling

        public ExternalProcessBuilder setUseWindowsBatFilesForWhitespaceHandling​(boolean useWindowsBatFilesForWhitespaceHandling)
      • getInput

        @Nullable
        public @Nullable String getInput()