Package org.jboss.util.xml
Class CatalogLocation
- java.lang.Object
-
- org.jboss.util.xml.CatalogLocation
-
public class CatalogLocation extends java.lang.Object
A ThreadSpecificCatalogs class maintains all catalogfilescatolog.xml
found in theThread.currentThread().getContextClassLoader()
.- Version:
- $Revision$
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]
catalogFilesNames
The catalog is assembled by taking into account all accessible resources whose name is META-INF/jax-ws-catalog.xml.private Resolver
catologResolver
private boolean
isLastEntityResolved
private java.net.URL
location
private static org.jboss.logging.Logger
log
-
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 boolean
equals(java.lang.Object other)
To catalog locations are qual if the location is equal.int
hashCode()
Two catalog locations have the same hash code if the location is equal.boolean
isEntityResolved()
Returns the boolean value to inform id DTD was found in the XML file or notprivate java.io.InputStream
loadResource(java.lang.String resolvedURI)
Loads the resolved resource.static java.net.URL
lookupCatalogFiles()
Seach the path for oasis catalog files.org.xml.sax.InputSource
resolveEntity(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.IOException
Tries 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.IOException
Seach the path for oasis catalog files. The classpath ofThread.currentThread().getContextClassLoader()
is used for the lookup.- Returns:
- the url where the
jax-ws-catalog.xml
is 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.IOException
Loads 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:
equals
in 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:
hashCode
in classjava.lang.Object
- Returns:
- - the hash code
-
-