private XMLStreamReader parse(InputStream is, String systemIdStr, boolean restricted) throws IOException, XMLStreamException { if (!quietmode) { LOG.debug("parsing input stream " + is); } if (is == null) { return null; } SystemId systemId = SystemId.construct(systemIdStr); ReaderConfig readerConfig = XML_INPUT_FACTORY.createPrivateConfig(); if (restricted) { readerConfig.setProperty(XMLInputFactory.SUPPORT_DTD, false); } return XML_INPUT_FACTORY.createSR(readerConfig, systemId, StreamBootstrapper.getInstance(null, systemId, is), false, true); }
public XMLStreamReader2 createXMLStreamReader(URL src) throws XMLStreamException { /* true for auto-close, since caller has no access to the underlying * input stream created from the URL */ return createSR(createPrivateConfig(), src, false, true); }
protected XMLStreamReader2 createSR(SystemId systemId, Reader r, boolean forER, boolean autoCloseInput) throws XMLStreamException { return createSR(createPrivateConfig(), systemId, ReaderBootstrapper.getInstance (null, systemId, r, null), forER, autoCloseInput); }
protected XMLStreamReader2 createSR(File f, boolean forER, boolean autoCloseInput) throws XMLStreamException { ReaderConfig cfg = createPrivateConfig(); try { /* 18-Nov-2008, TSa: If P_BASE_URL is set, and File reference is * relative, let's resolve against base... */ if (!f.isAbsolute()) { URL base = cfg.getBaseURL(); if (base != null) { URL src = new URL(base, f.getPath()); return createSR(cfg, SystemId.construct(src), URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } } final SystemId systemId = SystemId.construct(f.toURL()); return createSR(cfg, systemId, new FileInputStream(f), forER, autoCloseInput); } catch (IOException ie) { throw new WstxIOException(ie); } }
protected XMLStreamReader2 createSR(SystemId systemId, InputStream in, String enc, boolean forER, boolean autoCloseInput) throws XMLStreamException { // sanity check: if (in == null) { throw new IllegalArgumentException("Null InputStream is not a valid argument"); } ReaderConfig cfg = createPrivateConfig(); if (enc == null || enc.length() == 0) { return createSR(cfg, systemId, StreamBootstrapper.getInstance (null, systemId, in), forER, autoCloseInput); } /* !!! 17-Feb-2006, TSa: We don't yet know if it's xml 1.0 or 1.1; * so have to specify 1.0 (which is less restrictive WRT input * streams). Would be better to let bootstrapper deal with it * though: */ Reader r = DefaultInputResolver.constructOptimizedReader(cfg, in, false, enc); return createSR(cfg, systemId, ReaderBootstrapper.getInstance (null, systemId, r, enc), forER, autoCloseInput); }
public XMLEventReader2 createXMLEventReader(File f) throws XMLStreamException { /* true for auto-close, since caller has no access to the underlying * input stream created from the File */ return new WstxEventReader(createEventAllocator(), createSR(f, true, true)); }
mConfig = sf.createPrivateConfig(); mConfig.doSupportDTDs(true);
throws XMLStreamException ReaderConfig cfg = createPrivateConfig(); Reader r = null; InputStream in = null;
public XMLStreamReader2 createXMLStreamReader(URL src) throws XMLStreamException { /* true for auto-close, since caller has no access to the underlying * input stream created from the URL */ return createSR(createPrivateConfig(), src, false, true); }
@Override public XMLStreamReader2 createXMLStreamReader(URL src) throws XMLStreamException { /* true for auto-close, since caller has no access to the underlying * input stream created from the URL */ return createSR(createPrivateConfig(), src, false, true); }
public XMLStreamReader2 createXMLStreamReader(URL src) throws XMLStreamException { /* true for auto-close, since caller has no access to the underlying * input stream created from the URL */ return createSR(createPrivateConfig(), src, false, true); }
public XMLStreamReader2 createXMLStreamReader(URL src) throws XMLStreamException { /* true for auto-close, since caller has no access to the underlying * input stream created from the URL */ return createSR(createPrivateConfig(), src, false, true); }
protected XMLStreamReader2 createSR(File f, boolean forER, boolean autoCloseInput) throws XMLStreamException { try { return createSR(createPrivateConfig(), f.toURL(), new FileInputStream(f), forER, autoCloseInput); } catch (IOException ie) { throw new WstxIOException(ie); } }
protected XMLStreamReader2 createSR(String systemId, Reader r, boolean forER, boolean autoCloseInput) throws XMLStreamException { return createSR(createPrivateConfig(), systemId, ReaderBootstrapper.getInstance (r, null, systemId, null), forER, autoCloseInput); }
protected XMLStreamReader2 createSR(SystemId systemId, Reader r, boolean forER, boolean autoCloseInput) throws XMLStreamException { return createSR(createPrivateConfig(), systemId, ReaderBootstrapper.getInstance (null, systemId, r, null), forER, autoCloseInput); }
protected XMLStreamReader2 createSR(String systemId, Reader r, boolean forER, boolean autoCloseInput) throws XMLStreamException { return createSR(createPrivateConfig(), systemId, ReaderBootstrapper.getInstance (r, null, systemId, null), forER, autoCloseInput); }
protected XMLStreamReader2 createSR(SystemId systemId, Reader r, boolean forER, boolean autoCloseInput) throws XMLStreamException { return createSR(createPrivateConfig(), systemId, ReaderBootstrapper.getInstance (null, systemId, r, null), forER, autoCloseInput); }
@Override public XMLEventReader2 createXMLEventReader(File f) throws XMLStreamException { /* true for auto-close, since caller has no access to the underlying * input stream created from the File */ return new WstxEventReader(createEventAllocator(), createSR(f, true, true)); }
public XMLEventReader2 createXMLEventReader(File f) throws XMLStreamException { /* true for auto-close, since caller has no access to the underlying * input stream created from the File */ return new WstxEventReader(createEventAllocator(), createSR(f, true, true)); }
public XMLEventReader2 createXMLEventReader(File f) throws XMLStreamException { /* true for auto-close, since caller has no access to the underlying * input stream created from the File */ return new WstxEventReader(createEventAllocator(), createSR(f, true, true)); }