diff --git a/src/dorkbox/util/process/ShellAsyncExecutor.java b/src/dorkbox/util/process/ShellAsyncExecutor.java new file mode 100644 index 0000000..5a57fcd --- /dev/null +++ b/src/dorkbox/util/process/ShellAsyncExecutor.java @@ -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); + } +}