/** * Attempts to open an InputStream to the given resource at the specified path. * If the uri starts with "/" then the path is taken as relative to * the current context root. If the uri is a well formed URL then it * is used. Otherwise the uri is interpreted as relative to the current * context (the location of the current script). * * @return null if this resource could not be loaded, otherwise the resources * input stream is returned. */ public InputStream getResourceAsStream(String uri) { try { URL url = getResource(uri); return url.openStream(); } catch (Exception e) { if (log.isTraceEnabled()) { log.trace( "Caught exception attempting to open: " + uri + ". Exception: " + e, e); } return null; } }
/** * Attempts to open an InputStream to the given resource at the specified path. * If the uri starts with "/" then the path is taken as relative to * the current context root. If the uri is a well formed URL then it * is used. Otherwise the uri is interpreted as relative to the current * context (the location of the current script). * * @return null if this resource could not be loaded, otherwise the resources * input stream is returned. */ public InputStream getResourceAsStream(String uri) { try { URL url = getResource(uri); return url.openStream(); } catch (Exception e) { if (log.isTraceEnabled()) { log.trace( "Caught exception attempting to open: " + uri + ". Exception: " + e, e); } return null; } }
/** * Attempts to open an InputStream to the given resource at the specified path. * If the uri starts with "/" then the path is taken as relative to * the current context root. If the uri is a well formed URL then it * is used. Otherwise the uri is interpreted as relative to the current * context (the location of the current script). * * @return null if this resource could not be loaded, otherwise the resources * input stream is returned. */ public InputStream getResourceAsStream(String uri) { try { URL url = getResource(uri); return url.openStream(); } catch (Exception e) { if (log.isTraceEnabled()) { log.trace( "Caught exception attempting to open: " + uri + ". Exception: " + e, e); } return null; } }
/** * Attempts to open an InputStream to the given resource at the specified path. * If the uri starts with "/" then the path is taken as relative to * the current context root. If the uri is a well formed URL then it * is used. Otherwise the uri is interpreted as relative to the current * context (the location of the current script). * * @return null if this resource could not be loaded, otherwise the resources * input stream is returned. */ public InputStream getResourceAsStream(String uri) { try { URL url = getResource(uri); return url.openStream(); } catch (Exception e) { if (log.isTraceEnabled()) { log.trace( "Caught exception attempting to open: " + uri + ". Exception: " + e, e); } return null; } }
if (source instanceof String) { String uri = (String) source; source = context.getResource(uri);
/** * Parses the script from the given uri using the * JellyContext.getResource() API then compiles it and runs it. * * @return the new child context that was used to run the script */ public JellyContext runScript(String uri, XMLOutput output, boolean export, boolean inherit) throws JellyException { URL url = null; try { url = getResource(uri); } catch (MalformedURLException e) { throw new JellyException(e.toString()); } if (url == null) { throw new JellyException("Could not find Jelly script: " + url); } return runScript(url, output, export, inherit); }
/** * Parses the script from the given uri using the * JellyContext.getResource() API then compiles it and runs it. * * @return the new child context that was used to run the script */ public JellyContext runScript(String uri, XMLOutput output) throws JellyException { URL url = null; try { url = getResource(uri); } catch (MalformedURLException e) { throw new JellyException(e.toString()); } if (url == null) { throw new JellyException("Could not find Jelly script: " + url); } return runScript(url, output, JellyContext.DEFAULT_EXPORT, JellyContext.DEFAULT_INHERIT); }
/** * Parses the script from the given uri using the * JellyContext.getResource() API then compiles it and runs it. * * @return the new child context that was used to run the script */ public JellyContext runScript(String uri, XMLOutput output, boolean export, boolean inherit) throws JellyException { URL url = null; try { url = getResource(uri); } catch (MalformedURLException e) { throw new JellyException(e.toString()); } if (url == null) { throw new JellyException("Could not find Jelly script: " + url); } return runScript(url, output, export, inherit); }
/** * Parses the script from the given uri using the * JellyContext.getResource() API then compiles it and runs it. * * @return the new child context that was used to run the script */ public JellyContext runScript(String uri, XMLOutput output) throws JellyException { URL url = null; try { url = getResource(uri); } catch (MalformedURLException e) { throw new JellyException(e.toString()); } if (url == null) { throw new JellyException("Could not find Jelly script: " + url); } return runScript(url, output, JellyContext.DEFAULT_EXPORT, JellyContext.DEFAULT_INHERIT); }
/** * Parses the script from the given uri using the * JellyContext.getResource() API then compiles it and runs it. * * @return the new child context that was used to run the script */ public JellyContext runScript(String uri, XMLOutput output, boolean export, boolean inherit) throws JellyException { URL url = null; try { url = getResource(uri); } catch (MalformedURLException e) { throw new JellyException(e.toString()); } if (url == null) { throw new JellyException("Could not find Jelly script: " + url); } return runScript(url, output, export, inherit); }
/** * Parses the script from the given uri using the * JellyContext.getResource() API then compiles it and runs it. * * @return the new child context that was used to run the script */ public JellyContext runScript(String uri, XMLOutput output) throws JellyException { URL url = null; try { url = getResource(uri); } catch (MalformedURLException e) { throw new JellyException(e.toString()); } if (url == null) { throw new JellyException("Could not find Jelly script: " + url); } return runScript(url, output, JellyContext.DEFAULT_EXPORT, JellyContext.DEFAULT_INHERIT); }
/** * Parses the script from the given uri using the * JellyContext.getResource() API then compiles it and runs it. * * @return the new child context that was used to run the script */ public JellyContext runScript(String uri, XMLOutput output, boolean export, boolean inherit) throws JellyException { URL url = null; try { url = getResource(uri); } catch (MalformedURLException e) { throw new JellyException(e.toString()); } if (url == null) { throw new JellyException("Could not find Jelly script: " + url); } return runScript(url, output, export, inherit); }
/** * Parses the script from the given uri using the * JellyContext.getResource() API then compiles it and runs it. * * @return the new child context that was used to run the script */ public JellyContext runScript(String uri, XMLOutput output) throws JellyException { URL url = null; try { url = getResource(uri); } catch (MalformedURLException e) { throw new JellyException(e.toString()); } if (url == null) { throw new JellyException("Could not find Jelly script: " + url); } return runScript(url, output, JellyContext.DEFAULT_EXPORT, JellyContext.DEFAULT_INHERIT); }