public void SaveConfiguration() { if (this.config == null) { throw new Exception("Config is not loaded, cannot save"); } XmlConfiguration.SaveXmlConfiguration(this.configurationFile, this.config); }
/** * Does the actual work of reading the configuration from System * Properties and/or uddi.xml file. When the uddi.xml * file is updated the file will be reloaded. By default the reloadDelay is * set to 1 second to prevent excessive date stamp checking. */ private void loadConfiguration(String configurationFile, Properties properties) { if (config != null) { return; } String filename = null; //Properties from XML file if (!String.IsNullOrEmpty(configurationFile)) { filename = configurationFile; } else { String prop = System.Environment.GetEnvironmentVariable(ClientConfig.UDDI_CONFIG_FILENAME_PROPERTY); if (!String.IsNullOrEmpty(prop)) { filename = prop; } else { filename = UDDI_CONFIG_FILENAME_PROPERTY; } } log.info("Reading UDDI Client properties file " + filename); config = XmlConfiguration.LoadXmlConfiguration(filename); this.configurationFile = filename; //Properties from system properties IDictionaryEnumerator it = Environment.GetEnvironmentVariables().GetEnumerator(); while (it.MoveNext()) { config.getProperties().setProperty(it.Key.ToString(), it.Value.ToString()); } readConfig(properties); }