Package org.apache.solr.util
Class ModuleUtils
- java.lang.Object
-
- org.apache.solr.util.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 Summary
Constructors Constructor Description ModuleUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Path
getModuleLibPath(Path solrInstallDirPath, String moduleName)
Returns a path to a module's lib folderstatic Path
getModulesPath(Path solrInstallDirPath)
Returns path for modules directory, given the solr install dir pathstatic boolean
isValidName(String moduleName)
Returns true if module name is validstatic Set<String>
listAvailableModules(Path solrInstallDirPath)
Returns nam of all existing modulesstatic boolean
moduleExists(Path solrInstallDirPath, String moduleName)
Returns true if a module name is valid and exists in the systemstatic Collection<String>
resolveModulesFromStringOrSyspropOrEnv(String modulesFromString)
Parses comma separated string of module names, in practice found in solr.xml.
-
-
-
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 variableSOLR_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
-
-