1 package org.apache.lucene.demo.html; 2 3 18 19 import java.io.*; 20 21 class ParserThread extends Thread { 22 HTMLParser parser; 23 24 ParserThread(HTMLParser p) { 25 parser = p; 26 } 27 28 public void run() { try { 30 try { parser.HTMLDocument(); 32 } catch (ParseException e) { 33 System.out.println("Parse Aborted: " + e.getMessage()); } catch (TokenMgrError e) { 35 System.out.println("Parse Aborted: " + e.getMessage()); } finally { 37 parser.pipeOut.close(); 38 synchronized (parser) { 39 parser.summary.setLength(HTMLParser.SUMMARY_LENGTH); 40 parser.titleComplete = true; 41 parser.notifyAll(); 42 } 43 } 44 } catch (IOException e) { 45 e.printStackTrace(); 46 } 47 } 48 } 49 | Popular Tags |