*Added configuration plugin (OpenSim.Framework.Configuration.HTTP.dll) that fetches a file from a remote server

*Right now, values are not saved back to the remote server, but that will be changed
*Removed some warnings from invalid references that were not used anyways
This commit is contained in:
mingchen
2007-07-23 19:30:33 +00:00
parent f8c1366cbf
commit 87bddd32df
6 changed files with 174 additions and 12 deletions

View File

@@ -47,10 +47,19 @@ namespace OpenSim.Framework.Configuration
fileName = file;
}
private void LoadDataToClass()
{
rootNode = doc.FirstChild;
if (rootNode.Name != "Root")
throw new Exception("Error: Invalid .xml File. Missing <Root>");
configNode = rootNode.FirstChild;
if (configNode.Name != "Config")
throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>");
}
public void LoadData()
{
doc = new XmlDocument();
if (File.Exists(fileName))
{
XmlTextReader reader = new XmlTextReader(fileName);
@@ -67,14 +76,7 @@ namespace OpenSim.Framework.Configuration
rootNode.AppendChild(configNode);
}
rootNode = doc.FirstChild;
if (rootNode.Name != "Root")
throw new Exception("Error: Invalid .xml File. Missing <Root>");
configNode = rootNode.FirstChild;
if (configNode.Name != "Config")
throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>");
LoadDataToClass();
if (createdFile)
{
@@ -82,6 +84,13 @@ namespace OpenSim.Framework.Configuration
}
}
public void LoadDataFromString(string data)
{
doc = new XmlDocument();
doc.LoadXml(data);
LoadDataToClass();
}
public string GetAttribute(string attributeName)
{
string result = null;