Class ModuleUtils


  • public class ModuleUtils
    extends Object
    Parses the list of modules the user has requested in solr.xml, property solr.modules or environment SOLR_MODULES. Then resolves the lib folder for each, so they can be added to class path.
    • Constructor Detail

      • ModuleUtils

        public ModuleUtils()
    • Method Detail

      • getModuleLibPath

        public static Path getModuleLibPath​(Path solrInstallDirPath,
                                            String moduleName)
        Returns a path to a module's lib folder
        Parameters:
        moduleName - name of module
        Returns:
        the path to the module's lib folder
      • moduleExists

        public static boolean moduleExists​(Path solrInstallDirPath,
                                           String moduleName)
        Returns true if a module name is valid and exists in the system
      • listAvailableModules

        public static Set<String> listAvailableModules​(Path solrInstallDirPath)
        Returns nam of all existing modules
      • resolveModulesFromStringOrSyspropOrEnv

        public static Collection<String> resolveModulesFromStringOrSyspropOrEnv​(String modulesFromString)
        Parses comma separated string of module names, in practice found in solr.xml. If input string is empty (nothing configured) or null (e.g. tag not present in solr.xml), we continue to resolve from system property -Dsolr.modules and if still empty, fall back to environment variable SOLR_MODULES.
        Parameters:
        modulesFromString - raw string of comma-separated module names
        Returns:
        a set of module
      • isValidName

        public static boolean isValidName​(String moduleName)
        Returns true if module name is valid
      • getModulesPath

        public static Path getModulesPath​(Path solrInstallDirPath)
        Returns path for modules directory, given the solr install dir path