/** * Exec the process * @return the process * @throws IOException on aany failure to start the process * @throws FileNotFoundException if the process could not be found */ private Process spawnChildProcess() throws IOException { if (process != null) { throw new IOException("Process already started"); } if (LOG.isDebugEnabled()) { LOG.debug("Spawning process:\n " + describeBuilder()); } try { process = processBuilder.start(); } catch (IOException e) { // on windows, upconvert DOS error 2 from ::CreateProcess() // to its real meaning: FileNotFound if (e.toString().contains("CreateProcess error=2")) { FileNotFoundException fnfe = new FileNotFoundException(e.toString()); fnfe.initCause(e); throw fnfe; } else { throw e; } } return process; }
/** * Exec the process * @return the process * @throws IOException on aany failure to start the process * @throws FileNotFoundException if the process could not be found */ private Process spawnChildProcess() throws IOException { if (process != null) { throw new IOException("Process already started"); } if (LOG.isDebugEnabled()) { LOG.debug("Spawning process:\n " + describeBuilder()); } try { process = processBuilder.start(); } catch (IOException e) { // on windows, upconvert DOS error 2 from ::CreateProcess() // to its real meaning: FileNotFound if (e.toString().contains("CreateProcess error=2")) { FileNotFoundException fnfe = new FileNotFoundException(e.toString()); fnfe.initCause(e); throw fnfe; } else { throw e; } } return process; }