public bool Load (string fileName)
{
#if (XML_DEP)
this.fileName = fileName;
if (fileName == null
#if !TARGET_JVM
|| !File.Exists (fileName)
#endif
)
return false;
XmlTextReader reader = null;
try {
#if !TARGET_JVM
FileStream fs = new FileStream (fileName, FileMode.Open, FileAccess.Read);
#else
Stream fs = (Stream) vmw.common.IOUtils.getStream (fileName);
//patch for machine.config
if (fs == null && fileName.EndsWith ("machine.config")) {
fs = (Stream) IOUtils.getStreamForGHConfigs (fileName);
}
if (fs == null) {
return false;
}
#endif
reader = new XmlTextReader (fs);
if (InitRead (reader))
ReadConfigFile (reader);
} catch (ConfigurationException) {
throw;
} catch (Exception e) {
throw new ConfigurationException ("Error reading " + fileName, e);
} finally {
if (reader != null)
reader.Close();
}
#endif
return true;
}