blob: 9330556e76f9dc940bf478535e3592713b8f5025 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()));
}
}
|