You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2013/01/31 13:29:12 UTC
[jira] [Resolved] (CAMEL-4629) Add support for loading script from
file/classpath in the groovy/ognl/mvel etc components
[ https://issues.apache.org/jira/browse/CAMEL-4629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-4629.
--------------------------------
Resolution: Fixed
You can now prefix with "resource:classpath:foo.txt" to load the script from teh foo.txt from the classpath etc.
> Add support for loading script from file/classpath in the groovy/ognl/mvel etc components
> -----------------------------------------------------------------------------------------
>
> Key: CAMEL-4629
> URL: https://issues.apache.org/jira/browse/CAMEL-4629
> Project: Camel
> Issue Type: Improvement
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.11.0
>
>
> This allows these language components to be more usable, and for people to have scripts in external resources in the classpath or the file system.
> The script can be loaded like this code:
> {code}
> if (ResourceHelper.hasScheme(script)) {
> InputStream is = loadResource(script);
> answer = getCamelContext().getTypeConverter().convertTo(String.class, is);
> IOHelper.close(is);
> } else {
> // already a script so no need to load
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira