// May be factored out to a separate strategy later if we decide to support
// other languages than Groovy
private Class loadGroovyClass(URLConnection urlConnection, URL scriptURL) throws IOException, ScriptException {
GroovyClassLoader loader = new GroovyClassLoader(getClass().getClassLoader());
try {
Class scriptClass = loader.parseClass(urlConnection.getInputStream(), scriptURL.getFile());
return scriptClass;
} catch (CompilationFailedException e) {
throw new ScriptException(scriptURL, e);
}
}