cmdArray1[2] = (new File(outDir, tname)).getPath();
System.out.println(cmdArray1[0] + " " + cmdArray1[1] + " " + cmdArray1[2]);
Process executor = Runtime.getRuntime().exec(cmdArray1);
StreamPrinter outPrinter = new StreamPrinter(executor.getInputStream(), null, System.out);
StreamPrinter errPrinter = new StreamPrinter(executor.getErrorStream(), null, System.err);
outPrinter.start();
errPrinter.start();
int exitVal = executor.waitFor();
if (exitVal != 0) {
return exitVal;
}
// Capture code
cmdArray = new String[5];
cmdArray[0] = "cp";
cmdArray[1] = "-r";
cmdArray[2] = localPath.toUri().getPath();
cmdArray[3] = (new File(outDir, tname)).getPath();
System.out.println(cmdArray[0] + " " + cmdArray[1] + " " + cmdArray[2] + " " + cmdArray[3]);
}
Process executor = Runtime.getRuntime().exec(cmdArray);
StreamPrinter outPrinter = new StreamPrinter(executor.getInputStream(), null, System.out);
StreamPrinter errPrinter = new StreamPrinter(executor.getErrorStream(), null, System.err);
outPrinter.start();
errPrinter.start();
int exitVal = executor.waitFor();
return exitVal;
}