public static Process exec(String cmd, File dir, OutputStream out, OutputStream err) { return exec(new String[] {cmd}, dir, out, err); }
public static Process exec(String[] cmd, OutputStream out) { return exec(cmd, null, out, null); }
public static Process exec(String cmd, File dir, OutputStream out, OutputStream err) { return exec(new String[] {cmd}, dir, out, err); }
public static Process exec(String[] cmd) { return exec(cmd, null, System.out, null); }
public static Process exec(String cmd, File dir) { return exec(cmd, dir, System.out, null); }
public static Process exec(String cmd, OutputStream out) { return exec(cmd, null, out, null); }
public static Process exec(String cmd) { return exec(cmd, null, System.out, null); }
public static Process exec(String cmd) { return exec(cmd, null, System.out, null); }
public static Process exec(String[] cmd) { return exec(cmd, null, System.out, null); }
public static Process exec(String cmd, OutputStream out) { return exec(cmd, null, out, null); }
public static Process exec(String cmd, File dir) { return exec(cmd, dir, System.out, null); }
public static Process exec(String[] cmd, OutputStream out) { return exec(cmd, null, out, null); }
public static Process execCommandLineUtility(String[] cmd, OutputStream out, OutputStream err) { String osName = System.getProperty("os.name"); if (osName.startsWith("Windows")) { String[] temp = new String[cmd.length + 2]; System.arraycopy(cmd, 0, temp, 2, cmd.length); temp[0] = "cmd.exe"; temp[1] = "/C"; cmd = temp; } return exec(cmd, null, out, err); }
public static Process execCommandLineUtility(String[] cmd, OutputStream out, OutputStream err) { String osName = System.getProperty("os.name"); if (osName.startsWith("Windows")) { String[] temp = new String[cmd.length + 2]; System.arraycopy(cmd, 0, temp, 2, cmd.length); temp[0] = "cmd.exe"; temp[1] = "/C"; cmd = temp; } return exec(cmd, null, out, err); }
private static void setExecutable(File dir, FileFilter filter) { File[] files; if (filter != null) { files = dir.listFiles(filter); } else { files = dir.listFiles(); } for (File element : files) { ExecUtility.exec(new String[] { "chmod", "+x", element.getAbsolutePath() }); } } }