Package org.jboss.util.xml
Class CatalogLocation
- java.lang.Object
-
- org.jboss.util.xml.CatalogLocation
-
public class CatalogLocation extends java.lang.ObjectA ThreadSpecificCatalogs class maintains all catalogfilescatolog.xmlfound in theThread.currentThread().getContextClassLoader().- Version:
- $Revision$
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]catalogFilesNamesThe catalog is assembled by taking into account all accessible resources whose name is META-INF/jax-ws-catalog.xml.private ResolvercatologResolverprivate booleanisLastEntityResolvedprivate java.net.URLlocationprivate static org.jboss.logging.Loggerlog
-
Constructor Summary
Constructors Constructor Description CatalogLocation(java.net.URL url)Create a new CatalogLocation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)To catalog locations are qual if the location is equal.inthashCode()Two catalog locations have the same hash code if the location is equal.booleanisEntityResolved()Returns the boolean value to inform id DTD was found in the XML file or notprivate java.io.InputStreamloadResource(java.lang.String resolvedURI)Loads the resolved resource.static java.net.URLlookupCatalogFiles()Seach the path for oasis catalog files.org.xml.sax.InputSourceresolveEntity(java.lang.String publicId, java.lang.String systemId)Tries to resolve the entity using the thread specific catolog resolvers
-
-
-
Field Detail
-
log
private static org.jboss.logging.Logger log
-
catalogFilesNames
private static final java.lang.String[] catalogFilesNames
The catalog is assembled by taking into account all accessible resources whose name is META-INF/jax-ws-catalog.xml. Each resource MUST be a valid entity catalog according to the XML Catalogs
-
catologResolver
private final Resolver catologResolver
-
location
private final java.net.URL location
-
isLastEntityResolved
private boolean isLastEntityResolved
-
-
Method Detail
-
resolveEntity
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws java.net.MalformedURLException, java.io.IOExceptionTries to resolve the entity using the thread specific catolog resolvers- Parameters:
publicId- - Public ID of DTD, or null if it is a schemasystemId- - the system ID of DTD or Schema- Returns:
- InputSource of entity
- Throws:
java.net.MalformedURLException- - if the url is wrongjava.io.IOException- - error reading the local file
-
lookupCatalogFiles
public static java.net.URL lookupCatalogFiles() throws java.io.IOExceptionSeach the path for oasis catalog files. The classpath ofThread.currentThread().getContextClassLoader()is used for the lookup.- Returns:
- the url where the
jax-ws-catalog.xmlis located - Throws:
java.io.IOException- if the catalog files cannot be loaded
-
isEntityResolved
public boolean isEntityResolved()
Returns the boolean value to inform id DTD was found in the XML file or not- Returns:
- boolean - true if DTD was found in XML
-
loadResource
private java.io.InputStream loadResource(java.lang.String resolvedURI) throws java.io.IOExceptionLoads the resolved resource.- Parameters:
resolvedURI- - the full qualified URI of the resoved local ressource- Returns:
- - the inputstram represnting this resource
- Throws:
java.io.IOException- - if the resource cannot be opened
-
equals
public boolean equals(java.lang.Object other)
To catalog locations are qual if the location is equal.- Overrides:
equalsin classjava.lang.Object- Parameters:
other- - the catlog location to compare- Returns:
- true if equal
-
hashCode
public int hashCode()
Two catalog locations have the same hash code if the location is equal.- Overrides:
hashCodein classjava.lang.Object- Returns:
- - the hash code
-
-