summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/btr/proxy/util/EmptyXMLResolver.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/btr/proxy/util/EmptyXMLResolver.java')
-rw-r--r--src/main/java/com/btr/proxy/util/EmptyXMLResolver.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/com/btr/proxy/util/EmptyXMLResolver.java b/src/main/java/com/btr/proxy/util/EmptyXMLResolver.java
new file mode 100644
index 0000000..9330556
--- /dev/null
+++ b/src/main/java/com/btr/proxy/util/EmptyXMLResolver.java
@@ -0,0 +1,26 @@
+package com.btr.proxy.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/*****************************************************************************
+ * This resolver is used to prevent network lookups of DTD or XML schemas.
+ * @author Bernd Rosstauscher (proxyvole@rosstauscher.de) Copyright 2009
+ ****************************************************************************/
+
+public class EmptyXMLResolver implements EntityResolver {
+
+ /*************************************************************************
+ * Overwritten to return an empty entity.
+ * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
+ ************************************************************************/
+
+ public InputSource resolveEntity( String arg0, String arg1 ) throws SAXException, IOException {
+ return new InputSource( new ByteArrayInputStream("".getBytes()));
+ }
+
+}