57 import java.io.IOException; |
57 import java.io.IOException; |
58 import java.io.OutputStream; |
58 import java.io.OutputStream; |
59 import java.io.OutputStreamWriter; |
59 import java.io.OutputStreamWriter; |
60 import java.util.*; |
60 import java.util.*; |
61 |
61 |
62 import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowFileAccess; |
62 import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowExternalAccess; |
63 import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; |
63 import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; |
64 |
64 |
65 |
65 |
66 /** |
66 /** |
67 * Builds a DOM forest and maintains association from |
67 * Builds a DOM forest and maintains association from |
458 } |
458 } |
459 sources.add(ss); |
459 sources.add(ss); |
460 } |
460 } |
461 |
461 |
462 try { |
462 try { |
463 allowFileAccess(sf, options.disableXmlSecurity).newSchema(sources.toArray(new SAXSource[0])); |
463 allowExternalAccess(sf, "file,http", options.disableXmlSecurity).newSchema(sources.toArray(new SAXSource[0])); |
464 } catch (SAXException e) { |
464 } catch (SAXException e) { |
465 // error should have been reported. |
465 // error should have been reported. |
466 } catch (RuntimeException re) { |
466 } catch (RuntimeException re) { |
467 // JAXP RI isn't very trustworthy when it comes to schema error check, |
467 // JAXP RI isn't very trustworthy when it comes to schema error check, |
468 // and we know some cases where it just dies with NPE. So handle it gracefully. |
468 // and we know some cases where it just dies with NPE. So handle it gracefully. |