Interface ExecuteOptions
public interface ExecuteOptions
This interface defines options for executing a process.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExecuteOptionsCreates a newExecuteOptionsinstance.withEnvironmentVariable(String name, String value) Defines an environment variable to be used by the process.withExitCodeBehavior(ExitCodeBehavior behavior) Sets whether non-zero exit codes throw an exception, or are silently ignored.withStderrBehavior(StderrBehavior behavior) Sets how stderr (standard error) output is handled.withTimeout(int seconds) Sets the maximum duration the process is allowed to run in seconds.withTimeout(Duration duration) Sets the maximum duration the process is allowed to run.withTimeoutBehavior(TimeoutBehavior behavior) Sets the behavior regarding whether timeouts should throw an exception or be silently ignored.
-
Method Details
-
withTimeout
Sets the maximum duration the process is allowed to run in seconds. Defaults to 10 seconds. To disable the timeout, use 0.Use
withTimeoutBehavior(burp.api.montoya.utilities.shell.TimeoutBehavior)to define the behavior regarding whether timeouts should throw an exception or be silently ignored.- Parameters:
seconds- The timeout duration, in seconds. Use 0 for unlimited.- Returns:
- An
ExecuteOptionsinstance with the updated timeout.
-
withTimeout
Sets the maximum duration the process is allowed to run. Defaults to 10 seconds. To disable the timeout, useDuration.ZERO.Use
withTimeoutBehavior(burp.api.montoya.utilities.shell.TimeoutBehavior)to define the behavior regarding whether timeouts should throw an exception or be silently ignored.- Parameters:
duration- The timeout duration. UseDuration.ZEROfor unlimited.- Returns:
- An
ExecuteOptionsinstance with the updated timeout.
-
withTimeoutBehavior
Sets the behavior regarding whether timeouts should throw an exception or be silently ignored. Defaults toTimeoutBehavior.FAIL_ON_TIMEOUT.- Parameters:
behavior- The timeout behavior.- Returns:
- An
ExecuteOptionsinstance with the updated timeout behavior.
-
withStderrBehavior
Sets how stderr (standard error) output is handled. Defaults toStderrBehavior.DISCARD.- Parameters:
behavior- The stderr handling behavior.- Returns:
- An
ExecuteOptionsinstance with the updated stderr behavior.
-
withExitCodeBehavior
Sets whether non-zero exit codes throw an exception, or are silently ignored. Defaults toExitCodeBehavior.FAIL_ON_NON_ZERO.- Parameters:
behavior- The non-zero exit code handling behavior.- Returns:
- An
ExecuteOptionsinstance with the updated non-zero exit behavior.
-
withEnvironmentVariable
Defines an environment variable to be used by the process.- Parameters:
name- The variable name.value- The variable value.- Returns:
- An
ExecuteOptionsinstance with the added variable.
-
executeOptions
Creates a newExecuteOptionsinstance.- Returns:
- An
ExecuteOptionsinstance with default settings.
-