in src/main/java/com/epam/gmp/service/GroovyScriptEngineService.java [79:96]
public GroovyScriptEngine getEngine(org.springframework.core.io.Resource rootFolder) throws ScriptInitializationException {
GroovyScriptEngine engine = gseCache.get(rootFolder.toString());
try {
if (engine == null) {
URL[] roots = new URL[]{groovyRoot.exists() ? groovyRoot.getURL() : gmpHomeResource.getURL(), rootFolder.getURL()};
ClassLoader scriptClassLoader = buildClassloader(rootFolder);
if (scriptClassLoader != null) {
engine = new GroovyScriptEngine(roots, scriptClassLoader);
} else {
engine = new GroovyScriptEngine(roots, this.getClass().getClassLoader());
}
gseCache.put(rootFolder.toString(), engine);
}
return engine;
} catch (IOException e) {
throw new ScriptInitializationException("Unable to initialize groovy root at: " + rootFolder, e);
}
}