LOG.info("Parsing & compiling " + r.getFilename());
}
pluginClass = ((GroovyClassLoader)cl).parseClass(IOGroovyMethods.getText(r.getInputStream(), "UTF-8"));
}
catch (CompilationFailedException e) {
throw new PluginException("Error compiling plugin [" + r.getFilename() + "] " + e.getMessage(), e);
}
catch (IOException e) {
throw new PluginException("Error reading plugin [" + r.getFilename() + "] " + e.getMessage(), e);
}
}
else {
String className = null;
try {
className = GrailsResourceUtils.getClassName(r.getFile().getAbsolutePath());
} catch (IOException e) {
throw new PluginException("Cannot find plugin class [" + className + "] resource: [" + r.getFilename()+"]", e);
}
try {
pluginClass = Class.forName(className, true, cl);
}
catch (ClassNotFoundException e) {
throw new PluginException("Cannot find plugin class [" + className + "] resource: [" + r.getFilename()+"]", e);
}
}
return pluginClass;
}