private static int await( Process process ) { return new ProcessStreamHandler( process, true ).waitForResult(); }
args.addAll( asList( arguments ) ); Process process = Runtime.getRuntime().exec( args.toArray( new String[args.size()] ) ); final ProcessStreamHandler processOutput = new ProcessStreamHandler( process, false ); processOutput.launch(); final Future<Integer> realFuture = FutureAdapter.processFuture( process );
private void execAndWait( String... args ) throws Exception { Process process = Runtime.getRuntime().exec( args ); new ProcessStreamHandler( process, true ).waitForResult(); }