Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4629

Add support for loading script from file/classpath in the groovy/ognl/mvel etc components

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.11.0
    • None
    • None
    • Unknown

    Description

      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:

              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
      

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              davsclaus Claus Ibsen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: