public static Result sudo(long timeout,Pattern maskFilter,String... args){
  String userName=System.getProperty("user.name");
  if (userName.equals("root")) {
    return exec(timeout,maskFilter,args);
  }
  List<String> tmpList=new ArrayList(Arrays.asList(args));
  tmpList.add(0,"sudo");
  String[] newArray=tmpList.toArray(new String[tmpList.size()]);
  return exec(timeout,maskFilter,newArray);
}

public static Result sudo ( long timeout , Pattern maskFilter , String ... args ) { String userName = System . getProperty ( "user.name" ) ; if ( userName . equals ( "root" ) ) { return exec ( timeout , maskFilter , args ) ; } List < String > tmpList = new ArrayList ( Arrays . asList ( args ) ) ; tmpList . add ( 0 , "sudo" ) ; String [ ] newArray = tmpList . toArray ( new String [ tmpList . size ( ) ] ) ; return exec ( timeout , maskFilter , newArray ) ; }
maskfilter is for masking any matched string when printing stdoutput in log file .
