Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void exec_root(String cmd){
- String line = cmd;
- CommandLine commandLine = CommandLine.parse(line);
- DefaultExecutor executor = new DefaultExecutor();
- ResultHandler handler = new ResultHandler();
- ExecuteWatchdog watchdog = new ExecuteWatchdog(15000);
- executor.setWatchdog(watchdog);
- try {
- //int exitValue = executor.execute(commandLine);
- executor.execute(commandLine, handler);
- } catch (ExecuteException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment