Class ExecHelper
java.lang.Object
com.redhat.devtools.intellij.common.utils.ExecHelper
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic voidattachProcessToTerminal(com.intellij.execution.ui.ConsoleView terminalExecutionConsole, com.pty4j.PtyProcess p, boolean waitForProcessExit, Function<ProcessHandlerInput, ExecProcessHandler> processHandlerFunction, com.intellij.execution.process.ProcessListener processListener, String... command) createTerminalTabForReuse(com.intellij.openapi.project.Project project, String title) static Stringexecute(String executable, boolean checkExitCode, File workingDirectory, Map<String, String> envs, com.intellij.execution.process.ProcessListener listener, String... arguments) This method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)static Stringexecute(String executable, boolean checkExitCode, File workingDirectory, Map<String, String> envs, String... arguments) This method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)static StringThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)static StringThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)static StringThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)static StringThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)static StringThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)static StringThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)static ScheduledFuture<?>executeAfter(Runnable runnable, long delay, TimeUnit unit) static ExecHelper.ExecResultexecuteWithResult(String executable, boolean checkExitCode, File workingDirectory, Map<String, String> envs, String... arguments) static ExecHelper.ExecResultstatic voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, boolean waitForProcessToExit, String... command) static voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, boolean waitForProcessToExit, Map<String, String> envs, String... command) static voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, File workingDirectory, boolean waitForProcessToExit, Map<String, String> envs, com.intellij.execution.ui.ConsoleView terminalToReuse, Function<ProcessHandlerInput, ExecProcessHandler> processHandlerFunction, com.intellij.execution.process.ProcessListener processListener, String... command) static voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, File workingDirectory, boolean waitForProcessToExit, Map<String, String> envs, String... command) static voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, File workingDirectory, String... command) static voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, String... command) static voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, Map<String, String> envs, com.intellij.execution.ui.ConsoleView terminalToReuse, com.intellij.execution.process.ProcessListener processListener, String... command) static voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, Map<String, String> envs, com.intellij.execution.ui.ConsoleView terminalToReuse, String... command) static voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, Map<String, String> envs, com.intellij.execution.ui.ConsoleView terminalToReuse, Function<ProcessHandlerInput, ExecProcessHandler> processHandlerFunction, com.intellij.execution.process.ProcessListener processListener, String... command) static voidexecuteWithTerminal(com.intellij.openapi.project.Project project, String title, Map<String, String> envs, String... command) static voidexecuteWithUI(Map<String, String> envs, Runnable initRunnable, Consumer<String> runnable, String... command) static voidstatic voidlinkProcessToTerminal(com.pty4j.PtyProcess p, com.intellij.openapi.project.Project project, String title, boolean waitForProcessExit, String... command) static voidlinkProcessToTerminal(com.pty4j.PtyProcess p, com.intellij.openapi.project.Project project, String title, boolean waitForProcessExit, Function<ProcessHandlerInput, ExecProcessHandler> processHandlerFunction, com.intellij.execution.process.ProcessListener processListener, String... command) static void
-
Method Details
-
executeAfter
-
submit
-
execute
public static String execute(String executable, boolean checkExitCode, File workingDirectory, Map<String, String> envs, com.intellij.execution.process.ProcessListener listener, String... arguments) throws IOExceptionThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)- Parameters:
executable- the executablecheckExitCode- if exit code should be checkedworkingDirectory- the working directory for the processenvs- the map for the environment variableslistener- the process listenerarguments- the arguments- Returns:
- the combined output and error stream as a String
- Throws:
IOException- if error during process execution
-
execute
public static String execute(String executable, boolean checkExitCode, File workingDirectory, Map<String, String> envs, String... arguments) throws IOExceptionThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)- Parameters:
executable- the executablecheckExitCode- if exit code should be checkedworkingDirectory- the working directory for the processenvs- the map for the environment variablesarguments- the arguments- Returns:
- the combined output and error stream as a String
- Throws:
IOException- if error during process execution
-
execute
public static String execute(String executable, File workingDirectory, Map<String, String> envs, String... arguments) throws IOExceptionThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)- Parameters:
executable- the executableworkingDirectory- the working directory for the processenvs- the map for the environment variablesarguments- the arguments- Returns:
- the combined output and error stream as a String
- Throws:
IOException- if error during process execution
-
execute
public static String execute(String executable, Map<String, String> envs, String... arguments) throws IOExceptionThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)- Parameters:
executable- the executableenvs- the map for the environment variablesarguments- the arguments- Returns:
- the combined output and error stream as a String
- Throws:
IOException- if error during process execution
-
execute
This method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)- Parameters:
executable- the executablearguments- the arguments- Returns:
- the combined output and error stream as a String
- Throws:
IOException- if error during process execution
-
execute
public static String execute(String executable, File workingDirectory, String... arguments) throws IOException This method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)- Parameters:
executable- the executableworkingDirectory- the working directory for the processarguments- the arguments- Returns:
- the combined output and error stream as a String
- Throws:
IOException- if error during process execution
-
execute
public static String execute(String executable, boolean checkExitCode, Map<String, String> envs, String... arguments) throws IOExceptionThis method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)- Parameters:
executable- the executablecheckExitCode- if exit code should be checkedenvs- the map for the environment variablesarguments- the arguments- Returns:
- the combined output and error stream as a String
- Throws:
IOException- if error during process execution
-
execute
public static String execute(String executable, boolean checkExitCode, String... arguments) throws IOException This method combine out and err outputs in result string, if you need to have them separately use @linkexecuteWithResult(String, boolean, File, Map, String...)- Parameters:
executable- the executablecheckExitCode- if exit code should be checkedarguments- the arguments- Returns:
- the combined output and error stream as a String
- Throws:
IOException- if error during process execution
-
executeWithResult
public static ExecHelper.ExecResult executeWithResult(String executable, boolean checkExitCode, File workingDirectory, Map<String, String> envs, String... arguments) throws IOException- Throws:
IOException
-
executeWithResult
public static ExecHelper.ExecResult executeWithResult(String executable, Map<String, String> envs, String... arguments) throws IOException- Throws:
IOException
-
createTerminalTabForReuse
public static CommonTerminalExecutionConsole createTerminalTabForReuse(com.intellij.openapi.project.Project project, String title) -
linkProcessToTerminal
public static void linkProcessToTerminal(com.pty4j.PtyProcess p, com.intellij.openapi.project.Project project, String title, boolean waitForProcessExit, String... command) throws IOException - Parameters:
p- ptyprocessproject- projecttitle- tab titlewaitForProcessExit- waitcommand- must not be empty (for correct thread attribution in the stacktrace)- Throws:
IOException- if errors while processing
-
linkProcessToTerminal
public static void linkProcessToTerminal(com.pty4j.PtyProcess p, com.intellij.openapi.project.Project project, String title, boolean waitForProcessExit, Function<ProcessHandlerInput, ExecProcessHandler> processHandlerFunction, com.intellij.execution.process.ProcessListener processListener, String... command) throws IOException- Parameters:
p- ptyprocessproject- projecttitle- tab titlewaitForProcessExit- waitprocessHandlerFunction- the process handler functionprocessListener- listener to attach to the processcommand- must not be empty (for correct thread attribution in the stacktrace)- Throws:
IOException- if errors while processing
-
attachProcessToTerminal
public static void attachProcessToTerminal(com.intellij.execution.ui.ConsoleView terminalExecutionConsole, com.pty4j.PtyProcess p, boolean waitForProcessExit, Function<ProcessHandlerInput, ExecProcessHandler> processHandlerFunction, com.intellij.execution.process.ProcessListener processListener, String... command) throws IOException- Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, File workingDirectory, boolean waitForProcessToExit, Map<String, String> envs, com.intellij.execution.ui.ConsoleView terminalToReuse, Function<ProcessHandlerInput, throws IOExceptionExecProcessHandler> processHandlerFunction, com.intellij.execution.process.ProcessListener processListener, String... command) - Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, File workingDirectory, String... command) throws IOException - Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, boolean waitForProcessToExit, Map<String, String> envs, String... command) throws IOException- Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, boolean waitForProcessToExit, String... command) throws IOException - Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, Map<String, String> envs, String... command) throws IOException- Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, String... command) throws IOException - Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, File workingDirectory, boolean waitForProcessToExit, Map<String, String> envs, String... command) throws IOException- Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, Map<String, String> envs, com.intellij.execution.ui.ConsoleView terminalToReuse, String... command) throws IOException- Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, Map<String, String> envs, com.intellij.execution.ui.ConsoleView terminalToReuse, com.intellij.execution.process.ProcessListener processListener, String... command) throws IOException- Throws:
IOException
-
executeWithTerminal
public static void executeWithTerminal(com.intellij.openapi.project.Project project, String title, Map<String, String> envs, com.intellij.execution.ui.ConsoleView terminalToReuse, Function<ProcessHandlerInput, throws IOExceptionExecProcessHandler> processHandlerFunction, com.intellij.execution.process.ProcessListener processListener, String... command) - Throws:
IOException
-
executeWithUI
public static void executeWithUI(Map<String, String> envs, Runnable initRunnable, Consumer<String> runnable, String... command) throws IOException- Throws:
IOException
-
executeWithUI
public static void executeWithUI(Map<String, String> envs, Consumer<String> runnable, String... command) throws IOException- Throws:
IOException
-