155,19 → 155,11 |
long timeout) { |
ExecTask exe = new ExecTask(); |
RunTask runner = new RunTask(exe); |
|
/* |
Commandline cmdl = new Commandline(); |
cmdl.setExecutable(executable); |
cmdl.addArguments(args); |
System.out.println(cmdl.describeCommand()); |
*/ |
|
exe.setExecutable(executable); |
for (String s : args) { |
exe.createArg().setValue(s); |
} |
|
exe.setCommand(cmdl); |
exe.setDir(dir); |
if (spawn) { |
exe.setSpawn(spawn); |
183,7 → 175,15 |
exe.setVMLauncher(vmlauncher); |
exe.setSearchPath(searchpath); |
|
return runner.postTask(); |
Map<String, String> result = runner.postTask(); |
ReturnCode res = null; |
if (spawn) { |
res = new ReturnCode(0, null, null); |
} else { |
res = new ReturnCode(Integer.valueOf(result.get("ExecuteService.result")), |
result.get("ExecuteService.stdout"), result.get("ExecuteService.stderr")); |
} |
return res; |
} |
|
@WebMethod(exclude = true) |
203,7 → 203,12 |
sshexec.setTrust(true); |
sshexec.setTimeout(timeout); |
sshexec.setOutputproperty("SSHExec.stdout"); |
return runner.postTask(); |
Map<String, String> result = runner.postTask(); |
ReturnCode res = null; |
res = new ReturnCode(0, |
result.get("SSHExec.stdout"), ""); |
|
return res; |
} |
|
@WebMethod(exclude = true) |
225,7 → 230,12 |
sshexec.setTrust(true); |
sshexec.setTimeout(timeout); |
sshexec.setOutputproperty("SSHExec.stdout"); |
return runner.postTask(); |
Map<String, String> result = runner.postTask(); |
ReturnCode res = null; |
res = new ReturnCode(0, |
result.get("SSHExec.stdout"), ""); |
|
return res; |
} |
|
@WebMethod(exclude = true) |
244,7 → 254,12 |
rexec.setCommand(command); |
rexec.setTimeout((int) Math.round(timeout)); |
|
return runner.postTask(); |
Map<String, String> result = runner.postTask(); |
ReturnCode res = null; |
res = new ReturnCode(0, |
"", ""); |
|
return res; |
} |
|
@WebMethod(exclude = true) |
266,6 → 281,10 |
rexec.createWrite().addText(command); |
rexec.createRead().addText(expect); |
|
return runner.postTask(); |
Map<String, String> result = runner.postTask(); |
ReturnCode res = null; |
res = new ReturnCode(0, |
"", ""); |
return res; |
} |
} |