refactor(ModuleManager): factor out loadModulesFromApplicationPath
@@ -77,9 +77,7 @@ public ModuleManager(String masterServerAddress, List<Class<?>> classesOnClasspa
loadModulesFromClassPath();
- ModulePathScanner scanner = new ModulePathScanner(new ModuleLoader(metadataReader));
- scanner.getModuleLoader().setModuleInfoPath(TerasologyConstants.MODULE_INFO_FILENAME);
- scanner.scan(registry, pathManager.getModulePaths());
+ loadModulesFromApplicationPath(pathManager);
DependencyInfo engineDep = new DependencyInfo();
engineDep.setId(engineModule.getId());
@@ -93,6 +91,12 @@ public ModuleManager(String masterServerAddress, List<Class<?>> classesOnClasspa
installManager = new ModuleInstallManager(this, masterServerAddress);
}
+ private void loadModulesFromApplicationPath(PathManager pathManager) {
+ ModulePathScanner scanner = new ModulePathScanner(new ModuleLoader(metadataReader));
+ scanner.getModuleLoader().setModuleInfoPath(TerasologyConstants.MODULE_INFO_FILENAME);
+ scanner.scan(registry, pathManager.getModulePaths());
+ }
+
private Module loadEngineModule(List<Class<?>> classesOnClasspathsToAddToEngine) {
Module engineModule;
try (Reader reader = new InputStreamReader(getClass().getResourceAsStream("/engine-module.txt"), TerasologyConstants.CHARSET)) {
