Tries to find the module folder under /system/modules for a given module.<p>

@param moduleName the name of the module

@return the module folder, or null if this module doesn't have one
186158
private static String getModuleFolder(String moduleName) {

        if (moduleName == null) {
            return null;
        }
        CmsModule module = OpenCms.getModuleManager().getModule(moduleName);
        if (module != null) {
            for (String resource : module.getResources()) {
                if (CmsStringUtil.comparePaths("/system/modules/" + moduleName, resource)) {
                    return resource;
                }
            }
        }
        return null;
    }
818729
public Module lookupModule(String mod) {
        Module m = modules.get(mod);
        if (m == null) {
            m = new Module(mod, "???");
            modules.put(mod, m);
        }
        return m;
    }
720172
public function getModuleDirectory($moduleName)
    {
        if ($this->files->exists($this->path.'/'.$moduleName))
            return $this->path.'/'.$moduleName;

        else
            return false;
    }
1488
public static ModuleItem findModuleItem(String[] path) {
        if (disabled)
            return null;
        if (path == null || path[0].equals(APPSERVER_MODULE)) {
            return moduleRoot;
        }
        return moduleRoot.find(path, 0);
    }
628199
protected static String getMessageParentFolder(String moduleName) {

        CmsModule module = OpenCms.getModuleManager().getModule(moduleName);
        for (String resource : module.getResources()) {
            if (resource.contains(PATH_I18N + "/" + module.getName())) {
                return resource.substring(0, resource.indexOf(PATH_I18N));
            }
        }
        return "/system/modules/" + module.getName();
    }
705720
@Override
  @Nullable
  CompilerInput.ModuleType getModuleTypeByName(String moduleName) {
    return moduleTypesByName.get(moduleName);
  }
291056
public Module getModule(String role) {
        if(m_moduleContext.containsBean(role)){
            try{
                return m_moduleContext.getBean(role,Module.class);
            }
            catch(Throwable e){
                logger.warn(e.toString());
            }
        }
        return null;
    }
687139
public String getSubmoduleName() {
        if (path != null && path.length > SUBMODULE_INDEX)
            return path[SUBMODULE_INDEX];
        else
            return null;
    }
957985
public void exportModule(String moduleName) throws Exception {

        CmsModule module = OpenCms.getModuleManager().getModule(moduleName);

        if (module == null) {
            throw new CmsDbEntryNotFoundException(Messages.get().container(Messages.ERR_UNKNOWN_MODULE_1, moduleName));
        }

        String filename = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(
            OpenCms.getSystemInfo().getPackagesRfsPath()
                + CmsSystemInfo.FOLDER_MODULES
                + moduleName
                + "_"
                + OpenCms.getModuleManager().getModule(moduleName).getVersion().toString());

        List<String> moduleResources = CmsModule.calculateModuleResourceNames(m_cms, module);
        String[] resources = new String[moduleResources.size()];
        System.arraycopy(moduleResources.toArray(), 0, resources, 0, resources.length);

        // generate a module export handler
        CmsModuleImportExportHandler moduleExportHandler = new CmsModuleImportExportHandler();
        moduleExportHandler.setFileName(filename);
        moduleExportHandler.setAdditionalResources(resources);
        moduleExportHandler.setModuleName(module.getName().replace('\\', '/'));
        moduleExportHandler.setDescription(
            getMessages().key(
                Messages.GUI_SHELL_IMPORTEXPORT_MODULE_HANDLER_NAME_1,
                new Object[] {moduleExportHandler.getModuleName()}));

        // export the module
        OpenCms.getImportExportManager().exportData(
            m_cms,
            moduleExportHandler,
            new CmsShellReport(m_cms.getRequestContext().getLocale()));
    }
830770
def get_module_path(module_name):
    
    path = sys.path
    for name in module_name.split('.'):
        file_pointer, path, desc = imp.find_module(name, path)
        path = [path, ]
        if file_pointer is not None:
            file_pointer.close()

    return path[0]
347066
public IVarDef findVarPath( String pathName)
    {
    String[] path = DefUtils.toPath( pathName);
    IVarDef  var;

    return
      path == null?
      null :

      (var = getVarDef( StringUtils.trimToNull( path[0]))) == null?
      null :

      var.find( Arrays.copyOfRange( path, 1, path.length));
    }
1368629
public synchronized byte[] readLog(String moduleName) throws IOException {

        File logFile = getLogFile(moduleName);
        if (logFile.exists()) {
            return CmsFileUtil.readFile(logFile);
        } else {
            return new byte[] {};
        }
    }
897255
function resolveModulePath(moduleName) {
  let modulePath = path.dirname(require.resolve(moduleName));
  return locateLoaderFolder(modulePath)
}
514042
function scanTreeForNodesModules(moduleName) {
    var dir = settings.coreNodesDir;
    var results = [];
    var userDir;

    if (settings.userDir) {
        userDir = path.join(settings.userDir,"node_modules");
        results = scanDirForNodesModules(userDir,moduleName);
        results.forEach(function(r) { r.local = true; });
    }

    if (dir) {
        var up = path.resolve(path.join(dir,".."));
        while (up !== dir) {
            var pm = path.join(dir,"node_modules");
            if (pm != userDir) {
                results = results.concat(scanDirForNodesModules(pm,moduleName));
            }
            dir = up;
            up = path.resolve(path.join(dir,".."));
        }
    }
    return results;
}
1371681
private List<File> locateModules() {
    File[] files = modRoot.listFiles();
    List<File> modFiles = new ArrayList<>();
    for (File file : files) {
      if (file.isDirectory()) {
        // Check to determine whether the directory is a valid module directory.
        boolean isValid = true;
        try {
          new ModuleIdentifier(file.getName());
        } catch (Exception e) {
          isValid = false;
        }

        // If the directory is a valid module name then check for a mod.json file.
        if (isValid) {
          File modJson = new File(file, MOD_JSON_FILE);
          if (modJson.exists()) {
            modFiles.add(file);
          }
        }
      }
    }
    return modFiles;
  }
692619
public ModuleItem find(String name) {
        if (children == null)
            return null;
        else
            return (ModuleItem) children.get(name);

        /*
         * for(int i=0; i<children.size(); i++)
         * {
         * ModuleItem item = (ModuleItem)children.get(i);
         * if(item.instance != null)
         * {
         * if(item.instance.getName().equals(name))
         * return item;
         * }
         * }
         * return null;
         */
    }
843440
protected function getProjectModulePath(string $moduleName, PathTransfer $pathTransfer): ?string
    {
        $path = $this->pathBuilder->getProjectModulePathByModuleName($moduleName, $pathTransfer);

        if (!file_exists($path)) {
            return null;
        }

        return $path;
    }