Do not resolve external entities

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@292859 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl 2005-09-30 21:38:28 +00:00
parent 8b855c5e38
commit c6ef062ad4

View File

@ -21,6 +21,7 @@ package org.apache.maven;
import com.sun.msv.verifier.jaxp.SAXParserFactoryImpl; import com.sun.msv.verifier.jaxp.SAXParserFactoryImpl;
import java.io.File; import java.io.File;
import java.io.ByteArrayInputStream;
import javax.xml.parsers.*; import javax.xml.parsers.*;
@ -30,6 +31,7 @@ import org.apache.commons.logging.LogFactory;
import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.SAXParseException; import org.xml.sax.SAXParseException;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import org.xml.sax.InputSource;
/** /**
@ -50,6 +52,9 @@ public class JaxpMsvBean
/** For debug output. */ /** For debug output. */
private Log log = LogFactory.getLog(JaxpMsvBean.class); private Log log = LogFactory.getLog(JaxpMsvBean.class);
private static String EMPTY = "";
private static ByteArrayInputStream bais =
new ByteArrayInputStream(EMPTY.getBytes());
//~ Methods -------------------------------------------------------------- //~ Methods --------------------------------------------------------------
@ -79,6 +84,13 @@ public class JaxpMsvBean
log.error(e); log.error(e);
isValid = false; 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() public void endDocument()
{ {
if(isValid) if(isValid)