Class ScriptHelper


  • public final class ScriptHelper
    extends Object
    • Method Detail

      • resolveOptionalExternalScript

        public static String resolveOptionalExternalScript​(org.apache.camel.CamelContext camelContext,
                                                           String expression)
        Resolves the expression/predicate whether it refers to an external script on the file/classpath etc. This requires to use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy.

        If not then the returned value is returned as-is.

      • resolveOptionalExternalScript

        public static String resolveOptionalExternalScript​(org.apache.camel.CamelContext camelContext,
                                                           org.apache.camel.Exchange exchange,
                                                           String expression)
        Resolves the expression/predicate whether it refers to an external script on the file/classpath etc. This requires to use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy.

        If not then the returned value is returned as-is.

        If the exchange is provided (not null), then the external script can be referred via simple language for dynamic values, etc. resource:classpath:${header.myFileName}

      • hasExternalScript

        public static boolean hasExternalScript​(String external)