Author: carnold
Date: Thu Aug 23 10:06:59 2007
New Revision: 569073
URL: http://svn.apache.org/viewvc?rev=569073&view=rev
Log:
Eliminate need to resolve logger.dtd
Modified:
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingEntityResolver.java
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingXMLDecoder.java
Modified:
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingEntityResolver.java
URL:
http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingEntityResolver.java?rev=569073&r1=569072&r2=569073&view=diff
==============================================================================
---
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingEntityResolver.java
(original)
+++
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingEntityResolver.java
Thu Aug 23 10:06:59 2007
@@ -17,21 +17,16 @@
package org.apache.log4j.xml;
-import org.apache.log4j.LogManager;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
-import java.io.InputStream;
+import java.io.ByteArrayInputStream;
/**
* An [EMAIL PROTECTED] EntityResolver} specifically designed to return
- * <code>java 1.4's logging dtd, logger.dtd</code>
- * which is embedded within the log4j jar file. Based on EntityResolver.
+ * an empty InputSource for logger.dtd.
*
- *
- * @author Paul Austin
- * @author Scott Deboy ([EMAIL PROTECTED])
*/
public final class UtilLoggingEntityResolver implements EntityResolver {
@@ -47,17 +42,7 @@
public InputSource resolveEntity(final String publicId,
final String systemId) {
if (systemId.endsWith("logger.dtd")) {
- Class clazz = getClass();
- InputStream in =
- clazz.getResourceAsStream("/org/apache/log4j/xml/logger.dtd");
- if (in == null) {
- LogManager.getLogger(UtilLoggingEntityResolver.class).error(
- "Could not find [logger.dtd]. Used [" + clazz.getClassLoader()
- + "] class loader in the search.");
- return null;
- } else {
- return new InputSource(in);
- }
+ return new InputSource(new ByteArrayInputStream(new byte[0]));
} else {
return null;
}
Modified:
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingXMLDecoder.java
URL:
http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingXMLDecoder.java?rev=569073&r1=569072&r2=569073&view=diff
==============================================================================
---
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingXMLDecoder.java
(original)
+++
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/xml/UtilLoggingXMLDecoder.java
Thu Aug 23 10:06:59 2007
@@ -63,8 +63,7 @@
* Document prolog.
*/
private static final String BEGIN_PART =
- "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
- + "<!DOCTYPE log SYSTEM \"logger.dtd\"><log>";
+ "<log>";
/**
* Document close.
*/
@@ -163,7 +162,6 @@
InputSource inputSource =
new InputSource(new StringReader(buf.toString()));
- inputSource.setSystemId("dummy://logger.dtd");
document = docBuilder.parse(inputSource);
} catch (Exception e) {
e.printStackTrace();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]