public static List<GosuPathEntry> convertClasspathToGosuPathEntries(List<File> classpath) {
    // this is a hack to prevent loading of gosu directly from jar files in Diamond,
    // which prevents people from just embedding it in src and thus possibly having ND problems
    // it can be removed once "modules" are figured out in Emerald
    boolean loadingGosuFromJarsForbidden = Boolean.getBoolean(GW_FORBID_GOSU_JARS);
    ClassPathToGosuPathConverterBlock pathConverterBlock = new ClassPathToGosuPathConverterBlock();
    for (File f : classpath) {
      IDirectory dir = CommonServices.getFileSystem().getIDirectory(f);
      if (!f.getName().endsWith(".jar") || !loadingGosuFromJarsForbidden) {
        executeOnSourceDirectory(dir, pathConverterBlock);
      } else {
        // Ignore anything that's not a directory or jar file
      }      
    }
    return (List<GosuPathEntry>) pathConverterBlock.getPathEntries();
  }
public static List < GosuPathEntry > convertClasspathToGosuPathEntries ( List < File > classpath ) { boolean loadingGosuFromJarsForbidden = Boolean . getBoolean ( GW_FORBID_GOSU_JARS ) ; ClassPathToGosuPathConverterBlock pathConverterBlock = new ClassPathToGosuPathConverterBlock ( ) ; for ( File f : classpath ) { IDirectory dir = CommonServices . getFileSystem ( ) . getIDirectory ( f ) ; if ( ! f . getName ( ) . endsWith ( ".jar" ) || ! loadingGosuFromJarsForbidden ) { executeOnSourceDirectory ( dir , pathConverterBlock ) ; } else { } } return ( List < GosuPathEntry > ) pathConverterBlock . getPathEntries ( ) ; }
Converts a set of Files into a list of GosuPathEntries.  The algorithm is as follows.  For each File in the list,
if that file is a directory or a jar file, see if there's a module.xml file in the root.  If so, parse that file
and add in a GosuPathEntry based on the module definition.  If not, if the file is a directory, look for
a module.xml file in the parent directory.  If such a file exists, add in a GosuPathEntry based on that file.
If no module.xml file has been found in either case, add a GosuPath entry for the directory or jar file using
the directory or jar as the root and as the only source directory, and with an empty list of custom typeloaders.
If the file is not a directory and not a jar file, ignore it entirely.

In all cases, duplicate entries are ignored; if a GosuPathEntry is created previously for a File and the root
directory for that previous path entry is equal to or an ancestor of the root directory of the new path entry,
the new path entry is not added to the list.

@param classpath the list of Files to turn into GosuPathEntries
@return an ordered list of GosuPathEntries created based on the algorithm described above