Class ProcessExecutorUtil
java.lang.Object
ru.cg.webbpm.studio.core.api.utils.ProcessExecutorUtil
Утилитный класс для работы с zt-exec
user: Ildar date: 18.03.15
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Executes commandstatic int
Executes commandstatic org.zeroturnaround.exec.StartedProcess
executeInBackground
(Path directory, OutputStream output, org.zeroturnaround.exec.listener.ProcessListener listener, String... commands) static org.zeroturnaround.exec.ProcessExecutor
static void
killProcess
(org.zeroturnaround.exec.StartedProcess startedProcess)
-
Constructor Details
-
ProcessExecutorUtil
public ProcessExecutorUtil()
-
-
Method Details
-
execute
public static int execute(String... commands) throws InterruptedException, TimeoutException, IOException Executes command- Parameters:
commands
- - command and it's arguments- Returns:
- Exit code of command result
- Throws:
InterruptedException
TimeoutException
IOException
-
executeInBackground
public static org.zeroturnaround.exec.StartedProcess executeInBackground(Path directory, OutputStream output, org.zeroturnaround.exec.listener.ProcessListener listener, String... commands) throws IOException - Throws:
IOException
-
killProcess
public static void killProcess(org.zeroturnaround.exec.StartedProcess startedProcess) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
execute
public static int execute(Path directory, String... commands) throws InterruptedException, TimeoutException, IOException Executes command- Parameters:
directory
- - Sets this working directory for the process being executed.commands
- - command and it's arguments- Returns:
- Exit code of command result
- Throws:
InterruptedException
TimeoutException
IOException
-
executor
-