1 package org.enhydra.kelp.ant; 2 3 import java.io.BufferedReader ; 4 import java.io.PrintStream ; 5 import org.enhydra.kelp.common.AbstractEchoBuilder; 6 import java.io.PrintWriter ; 7 8 11 public class ErrorReader extends Thread { 12 BufferedReader er; 13 AbstractEchoBuilder aeg ; 14 PrintWriter log; 15 public ErrorReader(BufferedReader bufferedreader, AbstractEchoBuilder aEcho, PrintWriter logWriter) { 16 aeg = aEcho; 17 er = bufferedreader; 18 log = logWriter; 19 } 20 21 public void run() { 22 try { 23 for(; !er.ready(); Thread.sleep(100L)) { } 24 String s; 25 while((s = er.readLine()) != null) { 26 aeg.getEchoWriter().println(s); 27 if(log != null){ 28 log.println(s); 29 } 30 } 31 } 32 catch(Exception exception) { } 33 } 34 } | Popular Tags |