(String[] cmd)
| 65 | } |
| 66 | |
| 67 | public static void do_exec(String[] cmd) |
| 68 | throws Exception |
| 69 | { |
| 70 | Process p = ProcessImpl(cmd); |
| 71 | |
| 72 | byte[] stderr = readBytes(p.getErrorStream()); |
| 73 | byte[] stdout = readBytes(p.getInputStream()); |
| 74 | int exitValue = p.waitFor(); |
| 75 | if (exitValue == 0) { |
| 76 | throw new Exception("-----------------\r\n" + new String(stdout) + "-----------------\r\n"); |
| 77 | } |
| 78 | throw new Exception("-----------------\r\n" + new String(stderr) + "-----------------\r\n"); |
| 79 | } |
| 80 | |
| 81 | public static void main(String[] args) |
| 82 | throws Exception |
no test coverage detected