예제 #1
0
 /*     */ protected Resolver queryResolver(
     String resolver, String command, String arg1, String arg2)
       /*     */ {
   /* 363 */ InputStream iStream = null;
   /* 364 */ String RFC2483 =
       resolver + "?command=" + command + "&format=tr9401&uri=" + arg1 + "&uri2=" + arg2;
   /*     */
   /* 367 */ String line = null;
   /*     */ try
   /*     */ {
     /* 370 */ URL url = new URL(RFC2483);
     /*     */
     /* 372 */ URLConnection urlCon = url.openConnection();
     /*     */
     /* 374 */ urlCon.setUseCaches(false);
     /*     */
     /* 376 */ Resolver r = (Resolver) newCatalog();
     /*     */
     /* 378 */ String cType = urlCon.getContentType();
     /*     */
     /* 381 */ if (cType.indexOf(";") > 0) {
       /* 382 */ cType = cType.substring(0, cType.indexOf(";"));
       /*     */ }
     /*     */
     /* 385 */ r.parseCatalog(cType, urlCon.getInputStream());
     /*     */
     /* 387 */ return r;
     /*     */ } catch (CatalogException cex) {
     /* 389 */ if (cex.getExceptionType() == 6)
       /* 390 */ this.catalogManager.debug.message(1, "Unparseable catalog: " + RFC2483);
     /* 391 */ else if (cex.getExceptionType() == 5)
     /*     */ {
       /* 393 */ this.catalogManager.debug.message(1, "Unknown catalog format: " + RFC2483);
       /*     */ }
     /* 395 */ return null;
     /*     */ } catch (MalformedURLException mue) {
     /* 397 */ this.catalogManager.debug.message(1, "Malformed resolver URL: " + RFC2483);
     /* 398 */ return null;
     /*     */ } catch (IOException ie) {
     /* 400 */ this.catalogManager.debug.message(1, "I/O Exception opening resolver: " + RFC2483);
     /* 401 */ }
   return null;
   /*     */ }
예제 #2
0
 /*     */ private synchronized Vector resolveAllSubordinateCatalogs(
     int entityType, String entityName, String publicId, String systemId)
     /*     */ throws MalformedURLException, IOException
       /*     */ {
   /* 609 */ Vector resolutions = new Vector();
   /*     */
   /* 611 */ for (int catPos = 0; catPos < this.catalogs.size(); catPos++) {
     /* 612 */ Resolver c = null;
     /*     */ try
     /*     */ {
       /* 615 */ c = (Resolver) this.catalogs.elementAt(catPos);
       /*     */ } catch (ClassCastException e) {
       /* 617 */ String catfile = (String) this.catalogs.elementAt(catPos);
       /* 618 */ c = (Resolver) newCatalog();
       /*     */ try
       /*     */ {
         /* 621 */ c.parseCatalog(catfile);
         /*     */ } catch (MalformedURLException mue) {
         /* 623 */ this.catalogManager.debug.message(1, "Malformed Catalog URL", catfile);
         /*     */ } catch (FileNotFoundException fnfe) {
         /* 625 */ this.catalogManager.debug.message(
             1, "Failed to load catalog, file not found", catfile);
         /*     */ }
       /*     */ catch (IOException ioe) {
         /* 628 */ this.catalogManager.debug.message(
             1, "Failed to load catalog, I/O error", catfile);
         /*     */ }
       /*     */
       /* 631 */ this.catalogs.setElementAt(c, catPos);
       /*     */ }
     /*     */
     /* 634 */ String resolved = null;
     /*     */
     /* 637 */ if (entityType == DOCTYPE) {
       /* 638 */ resolved = c.resolveDoctype(entityName, publicId, systemId);
       /*     */
       /* 641 */ if (resolved != null)
       /*     */ {
         /* 643 */ resolutions.addElement(resolved);
         /* 644 */ return resolutions;
         /*     */ }
       /* 646 */ } else if (entityType == DOCUMENT) {
       /* 647 */ resolved = c.resolveDocument();
       /* 648 */ if (resolved != null)
       /*     */ {
         /* 650 */ resolutions.addElement(resolved);
         /* 651 */ return resolutions;
         /*     */ }
       /* 653 */ } else if (entityType == ENTITY) {
       /* 654 */ resolved = c.resolveEntity(entityName, publicId, systemId);
       /*     */
       /* 657 */ if (resolved != null)
       /*     */ {
         /* 659 */ resolutions.addElement(resolved);
         /* 660 */ return resolutions;
         /*     */ }
       /* 662 */ } else if (entityType == NOTATION) {
       /* 663 */ resolved = c.resolveNotation(entityName, publicId, systemId);
       /*     */
       /* 666 */ if (resolved != null)
       /*     */ {
         /* 668 */ resolutions.addElement(resolved);
         /* 669 */ return resolutions;
         /*     */ }
       /* 671 */ } else if (entityType == PUBLIC) {
       /* 672 */ resolved = c.resolvePublic(publicId, systemId);
       /* 673 */ if (resolved != null)
       /*     */ {
         /* 675 */ resolutions.addElement(resolved);
         /* 676 */ return resolutions;
         /*     */ }
       /*     */ } else {
       if (entityType == SYSTEM) {
         /* 679 */ Vector localResolutions = c.resolveAllSystem(systemId);
         /* 680 */ resolutions = appendVector(resolutions, localResolutions);
         /* 681 */ break;
         /* 682 */ }
       if (entityType == SYSTEMREVERSE) {
         /* 683 */ Vector localResolutions = c.resolveAllSystemReverse(systemId);
         /* 684 */ resolutions = appendVector(resolutions, localResolutions);
         /*     */ }
       /*     */ }
     /*     */ }
   /* 688 */ if (resolutions != null) {
     /* 689 */ return resolutions;
     /*     */ }
   /* 691 */ return null;
   /*     */ }