code: public void validateScript(String name, InputStream script, SourceFolder[] src, SourceFile[] files)
        throws MalformedScriptException
     {
        if (name != null && name.length() > 0 && name.startsWith("/"))
        {
           name = name.substring(1);
        }
        groovyPublisher.validateResource(script, name, src, files);
     }
docs: Check is specified source <code>script</code> contains valid Groovy source
  code.
  
  @param name script name. This name will be used by GroovyClassLoader to
  identify script, e.g. specified name will be used in error
  message in compilation of Groovy fails. If this parameter is
  <code>null</code> then GroovyClassLoader will use automatically
  generated name
  @param script Groovy source stream
  @param src set of folders that contains Groovy source files that should be
  add in class-path when validate <code>script</code>, see
  {@link SourceFolder#getPath()}. <b>NOTE</b> To be able load
  Groovy source files from specified folders the following rules
  must be observed:
  <ul>
  <li>Groovy source files must be located in folder with respect
  to package structure</li>
  <li>Name of Groovy source files must be the same as name of
  class located in file</li>
  <li>Groovy source file must have extension '.groovy'</li>
  </ul>
  @param files set of groovy source files that should be add in class-path
  when validate <code>script</code>. Each item must point directly
  to file that contains Groovy source, see
  {@link SourceFile#getPath()} . Source file can have any name and
  extension
  @throws MalformedScriptException if <code>script</code> contains not valid
  source code
  @LevelAPI Provisional