/** * Executes the specified command and arguments in a separate process, and * waits for the process to finish. * <p> * No input is passed to the process on STDIN. * * @param cmdarray * array containing the command to call and its arguments. * @param charset * Output from the executed command is expected to be in this * character set. * @return The results of the execution in an ExecHelper object. * @throws SecurityException * if a security manager exists and its checkExec method doesn't * allow creation of a subprocess. * @throws IOException - * if an I/O error occurs * @throws NullPointerException - * if cmdarray is null * @throws IndexOutOfBoundsException - * if cmdarray is an empty array (has length 0). * * */ public static ExecHelper exec(String[] cmdarray, String charset) throws IOException { return new ExecHelper(Runtime.getRuntime().exec(cmdarray), charset); }
/** * Executes the specified command and arguments in a separate process, and * waits for the process to finish. * <p> * Output from the process is expected to be text in the system's default * character set. * <p> * No input is passed to the process on STDIN. * * @param cmdarray * array containing the command to call and its arguments. * @return The results of the execution in an ExecHelper object. * @throws SecurityException * if a security manager exists and its checkExec method doesn't * allow creation of a subprocess. * @throws IOException - * if an I/O error occurs * @throws NullPointerException - * if cmdarray is null * @throws IndexOutOfBoundsException - * if cmdarray is an empty array (has length 0). * * */ public static ExecHelper exec(String[] cmdarray) throws IOException { return new ExecHelper(Runtime.getRuntime().exec(cmdarray), null); }
/** * Executes the specified command and arguments in a separate process, and * waits for the process to finish. * <p> * Output from the process is expected to be text in the system's default * character set. * <p> * No input is passed to the process on STDIN. * * @param cmdarray * array containing the command to call and its arguments. * @return The results of the execution in an ExecHelper object. * @throws SecurityException * if a security manager exists and its checkExec method doesn't * allow creation of a subprocess. * @throws IOException - * if an I/O error occurs * @throws NullPointerException - * if cmdarray is null * @throws IndexOutOfBoundsException - * if cmdarray is an empty array (has length 0). * * */ public static ExecHelper exec(String[] cmdarray) throws IOException { return new ExecHelper(Runtime.getRuntime().exec(cmdarray), null); }
/** * Executes the specified command and arguments in a separate process, and * waits for the process to finish. * <p> * No input is passed to the process on STDIN. * * @param cmdarray * array containing the command to call and its arguments. * @param charset * Output from the executed command is expected to be in this * character set. * @return The results of the execution in an ExecHelper object. * @throws SecurityException * if a security manager exists and its checkExec method doesn't * allow creation of a subprocess. * @throws IOException - * if an I/O error occurs * @throws NullPointerException - * if cmdarray is null * @throws IndexOutOfBoundsException - * if cmdarray is an empty array (has length 0). * * */ public static ExecHelper exec(String[] cmdarray, String charset) throws IOException { return new ExecHelper(Runtime.getRuntime().exec(cmdarray), charset); }
return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp, dir), charset);
return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp), null);
return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp), null);
return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp), charset);
return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp), charset);
return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp, dir), null);
return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp, dir), null);
return new ExecHelper(Runtime.getRuntime().exec(cmdarray, envp, dir), charset);
cmdarray = new String[] { "/bin/sh", "-c", command }; return new ExecHelper(Runtime.getRuntime().exec(cmdarray), charset);
cmdarray = new String[] { "/bin/sh", "-c", command }; return new ExecHelper(Runtime.getRuntime().exec(cmdarray), charset);