/* */ public void readCatalog(Catalog catalog, InputStream is)
/* */ throws IOException, CatalogException
/* */ {
/* 263 */ if ((this.parserFactory == null) && (this.parserClass == null)) {
/* 264 */ this.debug.message(1, "Cannot read SAX catalog without a parser");
/* 265 */ throw new CatalogException(6);
/* */ }
/* */
/* 268 */ this.debug = catalog.getCatalogManager().debug;
/* 269 */ EntityResolver bResolver = catalog.getCatalogManager().getBootstrapResolver();
/* */
/* 271 */ this.catalog = catalog;
/* */ try
/* */ {
/* 274 */ if (this.parserFactory != null) {
/* 275 */ SAXParser parser = this.parserFactory.newSAXParser();
/* 276 */ SAXParserHandler spHandler = new SAXParserHandler();
/* 277 */ spHandler.setContentHandler(this);
/* 278 */ if (bResolver != null) {
/* 279 */ spHandler.setEntityResolver(bResolver);
/* */ }
/* 281 */ parser.parse(new InputSource(is), spHandler);
/* */ } else {
/* 283 */ Parser parser = (Parser)Class.forName(this.parserClass).newInstance();
/* 284 */ parser.setDocumentHandler(this);
/* 285 */ if (bResolver != null) {
/* 286 */ parser.setEntityResolver(bResolver);
/* */ }
/* 288 */ parser.parse(new InputSource(is));
/* */ }
/* */ } catch (ClassNotFoundException cnfe) {
/* 291 */ throw new CatalogException(6);
/* */ } catch (IllegalAccessException iae) {
/* 293 */ throw new CatalogException(6);
/* */ } catch (InstantiationException ie) {
/* 295 */ throw new CatalogException(6);
/* */ } catch (ParserConfigurationException pce) {
/* 297 */ throw new CatalogException(5);
/* */ } catch (SAXException se) {
/* 299 */ Exception e = se.getException();
/* */
/* 301 */ UnknownHostException uhe = new UnknownHostException();
/* 302 */ FileNotFoundException fnfe = new FileNotFoundException();
/* 303 */ if (e != null) {
/* 304 */ if (e.getClass() == uhe.getClass()) {
/* 305 */ throw new CatalogException(7, e.toString());
/* */ }
/* 307 */ if (e.getClass() == fnfe.getClass()) {
/* 308 */ throw new CatalogException(7, e.toString());
/* */ }
/* */ }
/* */
/* 312 */ throw new CatalogException(se);
/* */ }
/* */ }