public void parseDmozFile(File dmozFile,int subsetDenom,boolean includeAdult,int skew,Pattern topicPattern,boolean snippet) throws IOException, SAXException, ParserConfigurationException {
  SAXParserFactory parserFactory=SAXParserFactory.newInstance();
  SAXParser parser=parserFactory.newSAXParser();
  XMLReader reader=parser.getXMLReader();
  RDFProcessor rp=new RDFProcessor(reader,subsetDenom,includeAdult,skew,topicPattern,snippet);
  reader.setContentHandler(rp);
  reader.setErrorHandler(rp);
  LOG.info("skew = " + rp.hashSkew);
  XMLCharFilter in=new XMLCharFilter(new BufferedReader(new InputStreamReader(new BufferedInputStream(new FileInputStream(dmozFile)),"UTF-8")));
  try {
    InputSource is=new InputSource(in);
    reader.parse(is);
  }
 catch (  Exception e) {
    if (LOG.isErrorEnabled()) {
      LOG.error("Failed to retieve the InputSource: ",e.toString());
    }
    System.exit(0);
  }
 finally {
    in.close();
  }
}

public void parseDmozFile ( File dmozFile , int subsetDenom , boolean includeAdult , int skew , Pattern topicPattern , boolean snippet ) throws IOException , SAXException , ParserConfigurationException { SAXParserFactory parserFactory = SAXParserFactory . newInstance ( ) ; SAXParser parser = parserFactory . newSAXParser ( ) ; XMLReader reader = parser . getXMLReader ( ) ; RDFProcessor rp = new RDFProcessor ( reader , subsetDenom , includeAdult , skew , topicPattern , snippet ) ; reader . setContentHandler ( rp ) ; reader . setErrorHandler ( rp ) ; LOG . info ( "skew = " + rp . hashSkew ) ; XMLCharFilter in = new XMLCharFilter ( new BufferedReader ( new InputStreamReader ( new BufferedInputStream ( new FileInputStream ( dmozFile ) ) , "UTF-8" ) ) ) ; try { InputSource is = new InputSource ( in ) ; reader . parse ( is ) ; } catch ( Exception e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( "Failed to retieve the InputSource: " , e . toString ( ) ) ; } System . exit ( 0 ) ; } finally { in . close ( ) ; } }
iterate through all the items in this structured dmoz file . add each url to the web db .
