1 11 package org.eclipse.help.internal.browser; 12 13 import java.io.*; 14 15 import org.eclipse.help.internal.base.*; 16 17 20 public class StreamConsumer extends Thread { 21 BufferedReader bReader; 22 23 private String lastLine; 24 25 public StreamConsumer(InputStream inputStream) { 26 super(); 27 setDaemon(true); 28 bReader = new BufferedReader(new InputStreamReader(inputStream)); 29 } 30 31 public void run() { 32 try { 33 String line; 34 while (null != (line = bReader.readLine())) { 35 lastLine = line; 36 BrowserLog.log(line); 37 } 38 bReader.close(); 39 } catch (IOException ioe) { 40 HelpBasePlugin.logError( 41 "Exception occurred reading from web browser.", ioe); } 43 } 44 45 48 public String getLastLine() { 49 return lastLine; 50 } 51 52 } 53 | Popular Tags |