Added Async Shell Executor

This commit is contained in:
nathan 2017-07-16 01:41:20 +02:00
parent 79c41e2a95
commit ec0772a9b0
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package dorkbox.util.process;
/**
*
*/
public
class ShellAsyncExecutor {
/**
* This is a convenience method to easily create a default process. Will immediately return, and does not wait for the process to finish
*
* @param executableName the name of the executable to run
* @param args the arguments for the executable
*
* @return true if the process ran successfully (exit value was 0), otherwise false
*/
public static void run(String executableName, String... args) {
ShellExecutor shell = new ShellExecutor();
shell.setExecutable(executableName);
shell.addArguments(args);
shell.createReadWriterThreads();
shell.start(false);
}
}