public XMLValidationSchema createSchema(URL url) throws XMLStreamException { try { InputStream in = URLUtil.inputStreamFromURL(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 { final SystemId systemId = SystemId.construct(src); try { return createSR(cfg, systemId, URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { InputStream in = URLUtil.inputStreamFromURL(url); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, in), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
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); } }
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.inputStreamFromURL(url); SystemId sysId = SystemId.construct(url); StreamBootstrapper bs = StreamBootstrapper.getInstance(pubId, sysId, in); Reader r = bs.bootstrapInput(cfg, false, xmlVersion); return InputSourceFactory.constructEntitySource (cfg, parent, refName, bs, pubId, sysId, xmlVersion, 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 sysId0 = ssrc.getSystemId(); URL ctxt = (parent == null) ? null : parent.getSource(); URL url = (sysId0 == null || sysId0.length() == 0) ? null : URLUtil.urlFromSystemId(sysId0, ctxt); final SystemId systemId = SystemId.construct(sysId0, (url == null) ? ctxt : url); 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.inputStreamFromURL(url); } bs = StreamBootstrapper.getInstance(pubId, systemId, in); } else { bs = ReaderBootstrapper.getInstance(pubId, systemId, r, null); } Reader r2 = bs.bootstrapInput(cfg, false, xmlVersion); return InputSourceFactory.constructEntitySource (cfg, parent, refName, bs, pubId, systemId, xmlVersion, r2); }
is = URLUtil.inputStreamFromURL(srcUrl); } catch (IOException ioe) { SAXException saxe = new SAXException(ioe);
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { try { InputStream in = URLUtil.inputStreamFromURL(url); InputSource src = new InputSource(in); src.setSystemId(url.toExternalForm()); return loadSchema(src, url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
@SuppressWarnings("resource") @Override public XMLValidationSchema createSchema(URL url) throws XMLStreamException { try { InputStream in = URLUtil.inputStreamFromURL(url); InputSource src = new InputSource(in); src.setSystemId(url.toExternalForm()); return loadSchema(src, url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
@SuppressWarnings("resource") @Override public XMLValidationSchema createSchema(URL url) throws XMLStreamException { try { InputStream in = URLUtil.inputStreamFromURL(url); InputSource src = new InputSource(in); src.setSystemId(url.toExternalForm()); return loadSchema(src, url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
@SuppressWarnings("resource") @Override public XMLValidationSchema createSchema(URL url) throws XMLStreamException { try { InputStream in = URLUtil.inputStreamFromURL(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 { final SystemId systemId = SystemId.construct(src); try { return createSR(cfg, systemId, URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
protected XMLStreamReader2 createSR(ReaderConfig cfg, URL src, boolean forER, boolean autoCloseInput) throws XMLStreamException { final SystemId systemId = SystemId.construct(src); try { return createSR(cfg, systemId, URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { InputStream in = URLUtil.inputStreamFromURL(url); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, in), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
protected XMLStreamReader2 createSR(ReaderConfig cfg, URL src, boolean forER, boolean autoCloseInput) throws XMLStreamException { final SystemId systemId = SystemId.construct(src); try { return createSR(cfg, systemId, URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
protected XMLStreamReader2 createSR(ReaderConfig cfg, URL src, boolean forER, boolean autoCloseInput) throws XMLStreamException { final SystemId systemId = SystemId.construct(src); try { return createSR(cfg, systemId, URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
@SuppressWarnings("resource") @Override public XMLValidationSchema createSchema(URL url) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { InputStream in = URLUtil.inputStreamFromURL(url); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, in), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
@SuppressWarnings("resource") @Override public XMLValidationSchema createSchema(URL url) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { InputStream in = URLUtil.inputStreamFromURL(url); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, in), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
@SuppressWarnings("resource") @Override public XMLValidationSchema createSchema(URL url) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { InputStream in = URLUtil.inputStreamFromURL(url); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, in), 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.inputStreamFromURL(url); SystemId sysId = SystemId.construct(url); StreamBootstrapper bs = StreamBootstrapper.getInstance(pubId, sysId, in); Reader r = bs.bootstrapInput(cfg, false, xmlVersion); return InputSourceFactory.constructEntitySource (cfg, parent, refName, bs, pubId, sysId, xmlVersion, r); }