- // WARNING: unix specific
- exitStatus = Runtime.getRuntime().exec(new String[]{
- "/bin/sh", "-c",
- command + " " +
- ">" + commandOutput.getAbsolutePath()
- }).waitFor();
- }
- catch (InterruptedException e) {
- throw new IOException(e.toString());
+ int exitStatus;
+ try {
+ // WARNING: unix specific
+
+ exitStatus = Runtime.getRuntime().exec(new String[]{
+ "/bin/sh", "-c",
+ command + " " +
+ ">" + commandOutput.getAbsolutePath()
+ }).waitFor();
+ }
+ catch (InterruptedException e) {
+ throw new IOException(e.toString());
+ }
+ if (exitStatus != 0) {
+ throw new IOException("command exit satus:" + exitStatus);
+ }
+ return FileRoutines.readFileIntoByteArray
+ (commandOutput.getAbsoluteFile());