Author: ltheussl
Date: Fri Sep 30 14:38:28 2005
New Revision: 292859

URL: http://svn.apache.org/viewcvs?rev=292859&view=rev
Log:
Do not resolve external entities

Modified:
    
maven/maven-1/plugins/trunk/plugin/src/main/org/apache/maven/JaxpMsvBean.java

Modified: 
maven/maven-1/plugins/trunk/plugin/src/main/org/apache/maven/JaxpMsvBean.java
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/plugin/src/main/org/apache/maven/JaxpMsvBean.java?rev=292859&r1=292858&r2=292859&view=diff
==============================================================================
--- 
maven/maven-1/plugins/trunk/plugin/src/main/org/apache/maven/JaxpMsvBean.java 
(original)
+++ 
maven/maven-1/plugins/trunk/plugin/src/main/org/apache/maven/JaxpMsvBean.java 
Fri Sep 30 14:38:28 2005
@@ -21,6 +21,7 @@
 import com.sun.msv.verifier.jaxp.SAXParserFactoryImpl;
 
 import java.io.File;
+import java.io.ByteArrayInputStream;
 
 import javax.xml.parsers.*;
 
@@ -30,6 +31,7 @@
 import org.xml.sax.helpers.DefaultHandler;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.SAXException;
+import org.xml.sax.InputSource;
 
 
 /**
@@ -50,6 +52,9 @@
     /** For debug output. */
     private Log log = LogFactory.getLog(JaxpMsvBean.class);
 
+    private static String EMPTY = "";
+    private static ByteArrayInputStream bais =
+        new ByteArrayInputStream(EMPTY.getBytes());
 
     //~ Methods --------------------------------------------------------------
 
@@ -78,6 +83,13 @@
             {
                 log.error(e);
                 isValid = false;
+            }
+            public InputSource resolveEntity(String publicId,
+                                 String systemId) throws SAXException
+            {
+                log.warn("WARNING: External entity " + systemId
+                    + " won't be resolved!");
+                return new InputSource(bais);
             }
             public void endDocument()
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to