1 21 22 package org.webdocwf.util.loader.wizard; 23 24 import java.io.BufferedReader ; 25 import java.io.PrintStream ; 26 import java.io.IOException ; 27 28 29 32 public class ErrorReader extends Thread { 33 BufferedReader er; 34 boolean trace = false; 35 40 public ErrorReader(BufferedReader bufferedReader) { 41 er = bufferedReader; 42 } 43 44 50 public ErrorReader(BufferedReader bufferedReader, boolean trace) { 51 er = bufferedReader; 52 this.trace = trace; 53 } 54 55 58 public void run() { 59 try { 60 for(; !er.ready(); Thread.sleep(100L)) { } 61 String s; 62 while((s = er.readLine()) != null) { 63 if (trace) 64 System.out.println(s+"\n"); 65 } 66 } catch (IOException e) { 67 } catch (InterruptedException e) { 68 } 69 } 70 } 71 | Popular Tags |