|
From: <tr...@us...> - 2003-07-08 02:46:56
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/config/light
In directory sc8-pr-cvs1:/tmp/cvs-serv20137/src/com/babeldoc/core/config/light
Modified Files:
LightConfigService.java
Log Message:
Now the getUrl uses the modules list to search for names...
Index: LightConfigService.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/config/light/LightConfigService.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** LightConfigService.java 27 Jun 2003 02:19:57 -0000 1.10
--- LightConfigService.java 8 Jul 2003 02:46:50 -0000 1.11
***************
*** 72,82 ****
import com.babeldoc.core.config.IConfig;
import com.babeldoc.core.config.IConfigService;
- import com.babeldoc.core.module.BabeldocModule;
- import com.babeldoc.core.module.BabeldocModuleList;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
- import java.io.InputStream;
import java.net.URL;
--- 72,79 ----
***************
*** 136,140 ****
Properties properties = new Properties();
! loadFromModules(newname, properties);
mergePropertiesFileFromUserSearchPath(newname, properties);
--- 133,137 ----
Properties properties = new Properties();
! // loadFromModules(newname, properties);
mergePropertiesFileFromUserSearchPath(newname, properties);
***************
*** 231,263 ****
output.close();
} catch (Exception ioex) {
- }
- }
- }
-
- /**
- * Run from the least dependant to the most dependant module, trying and load
- * the configuration matching the name.
- *
- * @param name
- * @param properties
- */
- private void loadFromModules(String name, Properties properties) {
- BabeldocModule[] modules = BabeldocModuleList.getInstance()
- .getSortedModules();
-
- for (int i = modules.length - 1; i >= 0; --i) {
- String moduleConfig = modules[i].getName() + "/" + name;
-
- // System.out.println("Trying to load: "+moduleConfig);
- InputStream is = Thread.currentThread().getContextClassLoader()
- .getResourceAsStream(moduleConfig);
-
- if (is != null) {
- try {
- // System.out.println("Loading: "+moduleConfig);
- properties.load(is);
- } catch (IOException e) {
- e.printStackTrace(); //TODO
- }
}
}
--- 228,231 ----
|