public static String exec ( final String cmd , final long timeout ) { final StringTokenizer st = new StringTokenizer ( cmd ) ; final String [ ] cmds = new String [ st . countTokens ( ) ] ; for ( int i = 0 ; st . hasMoreTokens ( ) ; i ++ ) { cmds [ i ] = st . nextToken ( ) ; } return exec ( cmds , timeout ) ; }
Executes the specified command with the specified timeout .