Guest User

Untitled

a guest
Jul 22nd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public void exec_root(String cmd){
  2.  
  3. String line = cmd;
  4. CommandLine commandLine = CommandLine.parse(line);
  5. DefaultExecutor executor = new DefaultExecutor();
  6. ResultHandler handler = new ResultHandler();
  7. ExecuteWatchdog watchdog = new ExecuteWatchdog(15000);
  8. executor.setWatchdog(watchdog);
  9.  
  10. try {
  11. //int exitValue = executor.execute(commandLine);
  12. executor.execute(commandLine, handler);
  13. } catch (ExecuteException e) {
  14. // TODO Auto-generated catch block
  15. e.printStackTrace();
  16. } catch (IOException e) {
  17. // TODO Auto-generated catch block
  18. e.printStackTrace();
  19. }
  20.  
  21. }
Add Comment
Please, Sign In to add comment