From 5eda30644fbb921b46b466a69ea45af56a19363b Mon Sep 17 00:00:00 2001 From: zzz Date: Wed, 12 Dec 2018 13:59:27 +0000 Subject: [PATCH] Util: Add another ShellCommand String[] method to be used by UrlLauncher --- core/java/src/net/i2p/util/ShellCommand.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/java/src/net/i2p/util/ShellCommand.java b/core/java/src/net/i2p/util/ShellCommand.java index c2e7f48f2d..dbfc43aafa 100644 --- a/core/java/src/net/i2p/util/ShellCommand.java +++ b/core/java/src/net/i2p/util/ShellCommand.java @@ -282,11 +282,30 @@ public class ShellCommand { * @return true if the spawned shell process * returns an exit status of 0 (indicating success), * else false. + * @deprecated Use the String[] method */ + @Deprecated public boolean executeSilentAndWait(String shellCommand) { return execute(shellCommand, CONSUME_OUTPUT, WAIT_FOR_EXIT_STATUS); } + /** + * Passes a command to the shell for execution. This method blocks until + * all of the command's resulting shell processes have completed. Any output + * produced by the executed command will not be displayed. + * + * @param commandArray The command for the shell to execute, + * as a String[]. + * See Runtime.exec(String[]) for more info. + * @return true if the spawned shell process + * returns an exit status of 0 (indicating success), + * else false. + * @since 0.9.38 + */ + public boolean executeSilentAndWait(String[] commandArray) { + return execute(commandArray, CONSUME_OUTPUT, WAIT_FOR_EXIT_STATUS); + } + /** * Passes a command to the shell for execution. This method blocks until * all of the command's resulting shell processes have completed unless a