public static ProcessBuilder newProcessBuilder(List<String> commandLine, boolean redirectErrorStream) { return newProcessBuilder(commandLine, new HashMap<>(), redirectErrorStream); }
public static ProcessBuilder newProcessBuilder(List<String> commandLine, boolean redirectErrorStream) { return newProcessBuilder(commandLine,new HashMap<String,String>(), redirectErrorStream); }
public static ProcessControl fromCommandLine(ISupportConfig runtime, List<String> commandLine, boolean redirectErrorStream) throws IOException { ProcessBuilder processBuilder = newProcessBuilder(commandLine, redirectErrorStream); return start(runtime, processBuilder); }
public static ProcessControl fromCommandLine(SupportConfig runtime, List<String> commandLine, boolean redirectErrorStream) throws IOException { ProcessBuilder processBuilder = newProcessBuilder(commandLine, redirectErrorStream); return start(runtime, processBuilder); }
public static boolean isProcessRunning(Platform platform, long pid) { try { final Process pidof; if (platform.isUnixLike()) { pidof = Runtime.getRuntime().exec( new String[] { "kill", "-0", "" + pid }); return pidof.waitFor() == 0; } else { // windows // process might be in either NOT RESPONDING due to // firewall blocking, or could be RUNNING final String[] cmd = { "tasklist.exe", "/FI", "PID eq " + pid ,"/FO", "CSV" }; logger.trace("Command: {}", Arrays.asList(cmd)); ProcessBuilder processBuilder = ProcessControl .newProcessBuilder(Arrays.asList(cmd), true); Process process = processBuilder.start(); // look for the PID in the output, pass it in for 'success' state LogWatchStreamProcessor logWatch = new LogWatchStreamProcessor(""+pid, new HashSet<String>(), StreamToLineProcessor.wrap(Processors.silent())); Processors.connect(new InputStreamReader(process.getInputStream()), logWatch); logWatch.waitForResult(2000); logger.trace("logWatch output: {}", logWatch.getOutput()); return logWatch.isInitWithSuccess(); } } catch (IOException | InterruptedException e) { logger.error("Trying to get process status", e); } return false; }
logger.trace("Command: {}", asList(cmd)); ProcessBuilder processBuilder = ProcessControl .newProcessBuilder(asList(cmd), true); Process process = processBuilder.start();
ProcessBuilder processBuilder = ProcessControl.newProcessBuilder( runtimeConfig.getCommandLinePostProcessor().process(distribution, getCommandLine(distribution, config, this.executable.getFile())),
ProcessBuilder processBuilder = ProcessControl.newProcessBuilder( runtimeConfig.getCommandLinePostProcessor().process(distribution, getCommandLine(distribution, config, this.executable.getFile())),