org.apache.wiki.auth.authorize
Class WebContainerAuthorizer.LocalEntityResolver

java.lang.Object
  extended by org.apache.wiki.auth.authorize.WebContainerAuthorizer.LocalEntityResolver
All Implemented Interfaces:
EntityResolver
Enclosing class:
WebContainerAuthorizer

public class WebContainerAuthorizer.LocalEntityResolver
extends Object
implements EntityResolver

XML entity resolver that redirects resolution requests by JDOM, JAXP and other XML parsers to locally-cached copies of the resources. Local resources are stored in the WEB-INF/dtd directory.

For example, Sun Microsystem's DTD for the webapp 2.3 specification is normally kept at http://java.sun.com/dtd/web-app_2_3.dtd. The local copy is stored at WEB-INF/dtd/web-app_2_3.dtd.


Constructor Summary
WebContainerAuthorizer.LocalEntityResolver()
           
 
Method Summary
 InputSource resolveEntity(String publicId, String systemId)
          Returns an XML input source for a requested external resource by reading the resource instead from local storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebContainerAuthorizer.LocalEntityResolver

public WebContainerAuthorizer.LocalEntityResolver()
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException,
                                 IOException
Returns an XML input source for a requested external resource by reading the resource instead from local storage. The local resource path is WEB-INF/dtd, plus the file name of the requested resource, minus the non-filename path information.

Specified by:
resolveEntity in interface EntityResolver
Parameters:
publicId - the public ID, such as -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
systemId - the system ID, such as http://java.sun.com/dtd/web-app_2_3.dtd
Returns:
the InputSource containing the resolved resource
Throws:
SAXException - if the resource cannot be resolved locally
IOException - if the resource cannot be opened
See Also:
EntityResolver.resolveEntity(java.lang.String, java.lang.String)


Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.