public XMLValidationSchema createSchema(URL url) throws XMLStreamException { try { InputStream in = URLUtil.optimizedStreamFromURL(url); InputSource src = new InputSource(in); src.setSystemId(url.toExternalForm()); return loadSchema(src, url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { try { InputStream in = URLUtil.optimizedStreamFromURL(url); InputSource src = new InputSource(in); src.setSystemId(url.toExternalForm()); return loadSchema(src, url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { try { InputStream in = URLUtil.optimizedStreamFromURL(url); InputSource src = new InputSource(in); src.setSystemId(url.toExternalForm()); return loadSchema(src, url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
protected XMLStreamReader2 createSR(ReaderConfig cfg, URL src, boolean forER, boolean autoCloseInput) throws XMLStreamException { try { return createSR(cfg, src, URLUtil.optimizedStreamFromURL(src), forER, autoCloseInput); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
protected XMLStreamReader2 createSR(ReaderConfig cfg, URL src, boolean forER, boolean autoCloseInput) throws XMLStreamException { try { return createSR(cfg, src, URLUtil.optimizedStreamFromURL(src), forER, autoCloseInput); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
protected XMLStreamReader2 createSR(ReaderConfig cfg, URL src, boolean forER, boolean autoCloseInput) throws XMLStreamException { try { return createSR(cfg, src, URLUtil.optimizedStreamFromURL(src), forER, autoCloseInput); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { InputStream in = URLUtil.optimizedStreamFromURL(url); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (in, null, null), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
private static WstxInputSource sourceFromURL(WstxInputSource parent, ReaderConfig cfg, String refName, int xmlVersion, URL url, String pubId) throws IOException, XMLStreamException { /* And then create the input source. Note that by default URL's * own input stream creation creates buffered reader -- for us * that's useless and wasteful (adds one unnecessary level of * caching, halving the speed due to copy operations needed), so * let's avoid it. */ InputStream in = URLUtil.optimizedStreamFromURL(url); String sysId = url.toExternalForm(); StreamBootstrapper bs = StreamBootstrapper.getInstance(in, pubId, sysId); Reader r = bs.bootstrapInput(cfg, false, xmlVersion); return InputSourceFactory.constructEntitySource (cfg, parent, refName, bs, pubId, sysId, xmlVersion, url, r); }
private static WstxInputSource sourceFromURL(WstxInputSource parent, ReaderConfig cfg, String refName, int xmlVersion, URL url, String pubId) throws IOException, XMLStreamException { /* And then create the input source. Note that by default URL's * own input stream creation creates buffered reader -- for us * that's useless and wasteful (adds one unnecessary level of * caching, halving the speed due to copy operations needed), so * let's avoid it. */ InputStream in = URLUtil.optimizedStreamFromURL(url); String sysId = url.toExternalForm(); StreamBootstrapper bs = StreamBootstrapper.getInstance(in, pubId, sysId); Reader r = bs.bootstrapInput(cfg, false, xmlVersion); return InputSourceFactory.constructEntitySource (cfg, parent, refName, bs, pubId, sysId, xmlVersion, url, r); }
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { InputStream in = URLUtil.optimizedStreamFromURL(url); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (in, null, null), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { InputStream in = URLUtil.optimizedStreamFromURL(url); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (in, null, null), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
private static WstxInputSource sourceFromURL(WstxInputSource parent, ReaderConfig cfg, String refName, int xmlVersion, URL url, String pubId) throws IOException, XMLStreamException { /* And then create the input source. Note that by default URL's * own input stream creation creates buffered reader -- for us * that's useless and wasteful (adds one unnecessary level of * caching, halving the speed due to copy operations needed), so * let's avoid it. */ InputStream in = URLUtil.optimizedStreamFromURL(url); String sysId = url.toExternalForm(); StreamBootstrapper bs = StreamBootstrapper.getInstance(in, pubId, sysId); Reader r = bs.bootstrapInput(cfg, false, xmlVersion); return InputSourceFactory.constructEntitySource (cfg, parent, refName, bs, pubId, sysId, xmlVersion, url, r); }
private static WstxInputSource sourceFromSS(WstxInputSource parent, ReaderConfig cfg, String refName, int xmlVersion, StreamSource ssrc) throws IOException, XMLStreamException { InputBootstrapper bs; Reader r = ssrc.getReader(); String pubId = ssrc.getPublicId(); String sysId = ssrc.getSystemId(); URL ctxt = (parent == null) ? null : parent.getSource(); URL url = (sysId == null || sysId.length() == 0) ? null : URLUtil.urlFromSystemId(sysId, ctxt); if (r == null) { InputStream in = ssrc.getInputStream(); if (in == null) { // Need to try just resolving the system id then if (url == null) { throw new IllegalArgumentException("Can not create StAX reader for a StreamSource -- neither reader, input stream nor system id was set."); } in = URLUtil.optimizedStreamFromURL(url); } bs = StreamBootstrapper.getInstance(in, pubId, sysId); } else { bs = ReaderBootstrapper.getInstance(r, pubId, sysId, null); } Reader r2 = bs.bootstrapInput(cfg, false, xmlVersion); return InputSourceFactory.constructEntitySource (cfg, parent, refName, bs, pubId, sysId, xmlVersion, ((url == null) ? ctxt : url), r2); }
private static WstxInputSource sourceFromSS(WstxInputSource parent, ReaderConfig cfg, String refName, int xmlVersion, StreamSource ssrc) throws IOException, XMLStreamException { InputBootstrapper bs; Reader r = ssrc.getReader(); String pubId = ssrc.getPublicId(); String sysId = ssrc.getSystemId(); URL ctxt = (parent == null) ? null : parent.getSource(); URL url = (sysId == null || sysId.length() == 0) ? null : URLUtil.urlFromSystemId(sysId, ctxt); if (r == null) { InputStream in = ssrc.getInputStream(); if (in == null) { // Need to try just resolving the system id then if (url == null) { throw new IllegalArgumentException("Can not create StAX reader for a StreamSource -- neither reader, input stream nor system id was set."); } in = URLUtil.optimizedStreamFromURL(url); } bs = StreamBootstrapper.getInstance(in, pubId, sysId); } else { bs = ReaderBootstrapper.getInstance(r, pubId, sysId, null); } Reader r2 = bs.bootstrapInput(cfg, false, xmlVersion); return InputSourceFactory.constructEntitySource (cfg, parent, refName, bs, pubId, sysId, xmlVersion, ((url == null) ? ctxt : url), r2); }
private static WstxInputSource sourceFromSS(WstxInputSource parent, ReaderConfig cfg, String refName, int xmlVersion, StreamSource ssrc) throws IOException, XMLStreamException { InputBootstrapper bs; Reader r = ssrc.getReader(); String pubId = ssrc.getPublicId(); String sysId = ssrc.getSystemId(); URL ctxt = (parent == null) ? null : parent.getSource(); URL url = (sysId == null || sysId.length() == 0) ? null : URLUtil.urlFromSystemId(sysId, ctxt); if (r == null) { InputStream in = ssrc.getInputStream(); if (in == null) { // Need to try just resolving the system id then if (url == null) { throw new IllegalArgumentException("Can not create StAX reader for a StreamSource -- neither reader, input stream nor system id was set."); } in = URLUtil.optimizedStreamFromURL(url); } bs = StreamBootstrapper.getInstance(in, pubId, sysId); } else { bs = ReaderBootstrapper.getInstance(r, pubId, sysId, null); } Reader r2 = bs.bootstrapInput(cfg, false, xmlVersion); return InputSourceFactory.constructEntitySource (cfg, parent, refName, bs, pubId, sysId, xmlVersion, ((url == null) ? ctxt : url), r2); }
is = URLUtil.optimizedStreamFromURL(srcUrl); } catch (IOException ioe) { SAXException saxe = new SAXException(ioe);
is = URLUtil.optimizedStreamFromURL(srcUrl); } catch (IOException ioe) { SAXException saxe = new SAXException(ioe);
is = URLUtil.optimizedStreamFromURL(srcUrl); } catch (IOException ioe) { SAXException saxe = new SAXException(ioe);