}
public static Streams processStreams( BufferedReader stderrReader, BufferedReader stdoutReader )
throws IOException, CommandExecutionException
{
Streams streams = new Streams();
while ( true )
{
String line = stderrReader.readLine();
if ( line == null )
{
break;
}
// TODO: I think we need to deal with exit codes instead, but IIRC there are some cases of errors that don't have exit codes
// ignore this error. TODO: output a warning
if ( !line.startsWith( "Could not chdir to home directory" ) &&
!line.endsWith( "ttyname: Operation not supported" ) )
{
streams.setErr( streams.getErr() + line + "\n" );
}
}
while ( true )
{
String line = stdoutReader.readLine();
if ( line == null )
{
break;
}
streams.setOut( streams.getOut() + line + "\n" );
}
// drain the output stream.
// TODO: we'll save this for the 1.0-alpha-8 line, so we can test it more. the -q arg in the
// unzip command should keep us until then...