diff options
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/EaafDomEntityResolver.java')
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/EaafDomEntityResolver.java | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/EaafDomEntityResolver.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/EaafDomEntityResolver.java index 6139e914..5a7dadc7 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/EaafDomEntityResolver.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/utils/EaafDomEntityResolver.java @@ -17,19 +17,20 @@ * works that you distribute must include a readable copy of the "NOTICE" text file. */ - - package at.gv.egiz.eaaf.core.impl.utils; import java.io.InputStream; -import at.gv.egiz.eaaf.core.api.data.XMLNamespaceConstants; + import org.apache.xerces.util.URI; import org.apache.xerces.util.URI.MalformedURIException; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; +import at.gv.egiz.eaaf.core.api.data.XmlNamespaceConstants; + /** - * An <code>EntityResolver</code> that looks up entities stored as local resources. + * An <code>EntityResolver</code> that looks up entities stored as local + * resources. * * <p> * The following DTDs are mapped to local resources: @@ -39,25 +40,27 @@ import org.xml.sax.InputSource; * </ul> * </p> * </p> - * For all other resources, an attempt is made to resolve them as resources, either absolute or - * relative to <code>Constants.SCHEMA_ROOT</code>. + * For all other resources, an attempt is made to resolve them as resources, + * either absolute or relative to <code>Constants.SCHEMA_ROOT</code>. * */ public class EaafDomEntityResolver implements EntityResolver { /** * Resolve an entity. - *<p> - * The <code>systemId</code> parameter is used to perform the lookup of the entity as a resource, - * either by interpreting the <code>systemId</code> as an absolute resource path, or by appending - * the last path component of <code>systemId</code> to <code>Constants.SCHEMA_ROOT</code>. - *</p> + * <p> + * The <code>systemId</code> parameter is used to perform the lookup of the + * entity as a resource, either by interpreting the <code>systemId</code> as an + * absolute resource path, or by appending the last path component of + * <code>systemId</code> to <code>Constants.SCHEMA_ROOT</code>. + * </p> * * @param publicId The public ID of the resource. * @param systemId The system ID of the resource. - * @return An <code>InputSource</code> from which the entity can be read, or <code>null</code>, if - * the entity could not be found. - * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) + * @return An <code>InputSource</code> from which the entity can be read, or + * <code>null</code>, if the entity could not be found. + * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, + * java.lang.String) */ @Override public InputSource resolveEntity(final String publicId, String systemId) { @@ -68,10 +71,10 @@ public class EaafDomEntityResolver implements EntityResolver { // check if we can resolve some standard dtd's if (publicId.equalsIgnoreCase("-//W3C//DTD XMLSchema 200102//EN")) { return new InputSource( - getClass().getResourceAsStream(XMLNamespaceConstants.SCHEMA_ROOT + "XMLSchema.dtd")); + getClass().getResourceAsStream(XmlNamespaceConstants.SCHEMA_ROOT + "XMLSchema.dtd")); } else if (publicId.equalsIgnoreCase("datatypes")) { return new InputSource( - getClass().getResourceAsStream(XMLNamespaceConstants.SCHEMA_ROOT + "datatypes.dtd")); + getClass().getResourceAsStream(XmlNamespaceConstants.SCHEMA_ROOT + "datatypes.dtd")); } } else if (systemId != null) { // get the URI path @@ -100,7 +103,7 @@ public class EaafDomEntityResolver implements EntityResolver { slashPos = systemId.lastIndexOf('/'); if (slashPos >= 0 && systemId.length() > slashPos) { systemId = systemId.substring(slashPos + 1, systemId.length()); - stream = getClass().getResourceAsStream(XMLNamespaceConstants.SCHEMA_ROOT + systemId); + stream = getClass().getResourceAsStream(XmlNamespaceConstants.SCHEMA_ROOT + systemId); if (stream != null) { final InputSource source = new InputSource(stream); |