protected synchronized String resolveSubordinateCatalogs ( int entityType , String entityName , String publicId , String systemId ) throws MalformedURLException , IOException { for ( int catPos = 0 ; catPos < catalogs . size ( ) ; catPos ++ ) { Catalog c = null ; try { c = ( Catalog ) catalogs . elementAt ( catPos ) ; } catch ( ClassCastException e ) { String catfile = ( String ) catalogs . elementAt ( catPos ) ; c = newCatalog ( ) ; try { c . parseCatalog ( catfile ) ; } catch ( MalformedURLException mue ) { catalogManager . debug . message ( 1 , "Malformed Catalog URL" , catfile ) ; } catch ( FileNotFoundException fnfe ) { catalogManager . debug . message ( 1 , "Failed to load catalog, file not found" , catfile ) ; } catch ( IOException ioe ) { catalogManager . debug . message ( 1 , "Failed to load catalog, I/O error" , catfile ) ; } catalogs . setElementAt ( c , catPos ) ; } String resolved = null ; // Ok, now what are we supposed to call here? if ( entityType == DOCTYPE ) { resolved = c . resolveDoctype ( entityName , publicId , systemId ) ; } else if ( entityType == DOCUMENT ) { resolved = c . resolveDocument ( ) ; } else if ( entityType == ENTITY ) { resolved = c . resolveEntity ( entityName , publicId , systemId ) ; } else if ( entityType == NOTATION ) { resolved = c . resolveNotation ( entityName , publicId , systemId ) ; } else if ( entityType == PUBLIC ) { resolved = c . resolvePublic ( publicId , systemId ) ; } else if ( entityType == SYSTEM ) { resolved = c . resolveSystem ( systemId ) ; } else if ( entityType == URI ) { resolved = c . resolveURI ( systemId ) ; } if ( resolved != null ) { return resolved ; } } return null ; }
Search the subordinate catalogs in order looking for a match .