FileDocCategorySizeDatePackage
Log4jEntityResolver.javaAPI DocApache log4j 1.2.151763Sat Aug 25 00:09:42 BST 2007org.apache.log4j.xml

Log4jEntityResolver

public class Log4jEntityResolver extends Object implements EntityResolver
An {@link EntityResolver} specifically designed to return log4j.dtd which is embedded within the log4j jar file.
author
Paul Austin

Fields Summary
Constructors Summary
Methods Summary
public org.xml.sax.InputSourceresolveEntity(java.lang.String publicId, java.lang.String systemId)

    if (systemId.endsWith("log4j.dtd")) {
      Class clazz = getClass();
      InputStream in = clazz.getResourceAsStream("/org/apache/log4j/xml/log4j.dtd");
      if (in == null) {
	    LogLog.warn("Could not find [log4j.dtd] using [" + clazz.getClassLoader()
		     + "] class loader, parsed without DTD.");
        in = new ByteArrayInputStream(new byte[0]);
      }
	  return new InputSource(in);
    } else {
      return null;
    }