| CODENOTIFIER | HelpYou are not signed inSign in |
Project: ProActive
Revision: 10040
Author: acontes
Date: 02 Sep 2008 13:04:52
Changes:fix for PROACTIVE-455
Files:| ... | ...@@ -32,6 +32,7 @@ | |
| 32 | 32 | package org.objectweb.proactive.core.config; |
| 33 | 33 | |
| 34 | 34 | import java.io.File; |
| 35 | import java.net.URL; | |
| 35 | 36 | import java.util.HashMap; |
| 36 | 37 | import java.util.Map; |
| 37 | 38 | import java.util.Properties; |
| ... | ...@@ -78,7 +79,7 @@ | |
| 78 | 79 | public static final String PROACTIVE_LOG_PROPERTIES_FILE = "ProActiveLoggers.properties"; |
| 79 | 80 | |
| 80 | 81 | /** User configuration directory */ |
| 81 | protected static final String PROACTIVE_USER_CONFIG_FILENAME = Constants.USER_CONFIG_DIR + | |
| 82 | protected static final String PROACTIVE_USER_CONFIG_FILENAME = "file:///" + Constants.USER_CONFIG_DIR + | |
| 82 | 83 | File.separator + PROACTIVE_CONFIG_FILENAME; |
| 83 | 84 | |
| 84 | 85 | protected final Logger logger = ProActiveLogger.getLogger(Loggers.CONFIGURATION); |
| ... | ...@@ -244,19 +245,14 @@ | |
| 244 | 245 | if (fname == null) { |
| 245 | 246 | fname = PROACTIVE_USER_CONFIG_FILENAME; |
| 246 | 247 | } |
| 247 | ||
| 248 | /* Check that this file exists */ | |
| 249 | File file = new File(fname); | |
| 250 | if (file.exists()) { | |
| 251 | String userConfigFile = file.getAbsolutePath(); | |
| 252 | ||
| 253 | logger.debug("User Config File is: " + userConfigFile); | |
| 254 | userProps = ProActiveConfigurationParser.parse(userConfigFile, userProps); | |
| 255 | } else { | |
| 256 | if (!fname.equals(PROACTIVE_CONFIG_FILENAME)) { | |
| 257 | // don't print a warning if the default user config file does not exist | |
| 258 | logger.warn("Configuration file " + fname + " not found"); | |
| 259 | } | |
| 248 | URL u = null; | |
| 249 | try { | |
| 250 | u = new URL(fname); | |
| 251 | u.openStream(); | |
| 252 | logger.debug("User Config File is: " + u.toExternalForm()); | |
| 253 | userProps = ProActiveConfigurationParser.parse(u.toString(), userProps); | |
| 254 | } catch (Exception e) { | |
| 255 | logger.warn("Configuration file " + u.toExternalForm() + " not found"); | |
| 260 | 256 | } |
| 261 | 257 | |
| 262 | 258 | return userProps; |