1 19 20 26 package org.enhydra.dods.generator; 27 28 import java.io.BufferedReader ; 29 import java.io.IOException ; 30 31 34 public class ErrorReader extends Thread { 35 BufferedReader er; 36 boolean trace = false; 37 38 43 public ErrorReader(BufferedReader bufferedReader) { 44 er = bufferedReader; 45 } 46 47 53 public ErrorReader(BufferedReader bufferedReader, boolean trace) { 54 er = bufferedReader; 55 this.trace = trace; 56 } 57 58 public void run() { 59 try { 60 for (; !er.ready(); Thread.sleep(100L)) {} 61 String s; 62 63 while ((s = er.readLine()) != null) { 64 if (trace) { 65 System.out.println(s + "\n"); 66 } 67 } 68 } catch (IOException e) {} catch (InterruptedException e) {} 69 } 70 } 71 | Popular Tags |