protected final WaitForProcess startInternal ( ) throws IOException { // Invoke listeners - they can modify this executor listeners . beforeStart ( this ) ; if ( builder . command ( ) . isEmpty ( ) ) { throw new IllegalStateException ( "Command has not been set." ) ; } validateStreams ( streams , readOutput ) ; applyEnvironment ( ) ; messageLogger . message ( log , getExecutingLogMessage ( ) ) ; Process process = invokeStart ( ) ; messageLogger . message ( log , "Started {}" , process ) ; ProcessAttributes attributes = getAttributes ( ) ; ExecuteStreamHandler newStreams = streams ; ByteArrayOutputStream out = null ; if ( readOutput ) { PumpStreamHandler pumps = ( PumpStreamHandler ) streams ; out = new ByteArrayOutputStream ( ) ; newStreams = redirectOutputAlsoTo ( pumps , out ) ; } return startInternal ( process , attributes , newStreams , out ) ; }
Start the process and its stream handlers .