private synchronized Vector resolveAllSubordinateCatalogs ( int entityType , String entityName , String publicId , String systemId ) throws MalformedURLException , IOException { Vector resolutions = new Vector ( ) ; for ( int catPos = 0 ; catPos < catalogs . size ( ) ; catPos ++ ) { Resolver c = null ; try { c = ( Resolver ) catalogs . elementAt ( catPos ) ; } catch ( ClassCastException e ) { String catfile = ( String ) catalogs . elementAt ( catPos ) ; c = ( Resolver ) 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 ) ; if ( resolved != null ) { // Only find one DOCTYPE resolution resolutions . addElement ( resolved ) ; return resolutions ; } } else if ( entityType == DOCUMENT ) { resolved = c . resolveDocument ( ) ; if ( resolved != null ) { // Only find one DOCUMENT resolution resolutions . addElement ( resolved ) ; return resolutions ; } } else if ( entityType == ENTITY ) { resolved = c . resolveEntity ( entityName , publicId , systemId ) ; if ( resolved != null ) { // Only find one ENTITY resolution resolutions . addElement ( resolved ) ; return resolutions ; } } else if ( entityType == NOTATION ) { resolved = c . resolveNotation ( entityName , publicId , systemId ) ; if ( resolved != null ) { // Only find one NOTATION resolution resolutions . addElement ( resolved ) ; return resolutions ; } } else if ( entityType == PUBLIC ) { resolved = c . resolvePublic ( publicId , systemId ) ; if ( resolved != null ) { // Only find one PUBLIC resolution resolutions . addElement ( resolved ) ; return resolutions ; } } else if ( entityType == SYSTEM ) { Vector localResolutions = c . resolveAllSystem ( systemId ) ; resolutions = appendVector ( resolutions , localResolutions ) ; break ; } else if ( entityType == SYSTEMREVERSE ) { Vector localResolutions = c . resolveAllSystemReverse ( systemId ) ; resolutions = appendVector ( resolutions , localResolutions ) ; } } if ( resolutions != null ) { return resolutions ; } else { return null ; } }
Search the subordinate catalogs in order looking for all match .