code: public ExtendedGroovyClassLoader getGroovyClassLoader(SourceFolder[] sources) throws MalformedURLException
     {
        if (sources == null || sources.length == 0)
           return getGroovyClassLoader();
  
        URL[] roots = new URL[sources.length];
        for (int i = 0; i < sources.length; i++)
           roots[i] = sources[i].getPath();
  
        final GroovyClassLoader parent = getGroovyClassLoader();
        JcrGroovyClassLoader classLoader = SecurityHelper.doPrivilegedAction(new PrivilegedAction<JcrGroovyClassLoader>() {
           public JcrGroovyClassLoader run()
           {
              return new JcrGroovyClassLoader(parent);
           }
        });
        classLoader.setResourceLoader(new JcrGroovyResourceLoader(roots));
        return classLoader;
     }
docs: {@inheritDoc}