/** * Gets a InputStream for the resource identified by a resolved URI. */ protected InputStream openStream(String uri) { java.io.InputStream is = null; try { URI urlObj = new URI(uri); String protocol = urlObj.getScheme(); if (hasProtocolFactory(protocol)) { return getProtocolFactory(protocol).getUrl(uri).getStream(); } else { try { is = new URL(uri).openStream(); } catch (java.net.MalformedURLException e) { XRLog.exception("bad URL given: " + uri, e); } catch (java.io.FileNotFoundException e) { XRLog.exception("item at URI " + uri + " not found", e); } catch (java.io.IOException e) { XRLog.exception("IO problem for " + uri, e); } } } catch (URISyntaxException e1) { XRLog.exception("bad URL given: " + uri, e1); } return is; }
return getProtocolFactory(protocol).getUrl(uri).getReader();