private void compileScriptResource(final Resource script) { this.groovyScript = ScriptingUtils.parseGroovyScript(script, true); }
@SneakyThrows private static <T> T getGroovyResult(final Resource groovyScript, final String methodName, final Object[] args, final Class<T> clazz, final boolean failOnError) { try { val groovyObject = parseGroovyScript(groovyScript, failOnError); if (groovyObject == null) { LOGGER.error("Could not parse the Groovy script at [{}]", groovyScript); return null; } return executeGroovyScript(groovyObject, methodName, args, clazz, failOnError); } catch (final Exception e) { if (failOnError) { throw e; } LOGGER.error(e.getMessage(), e); } return null; }