aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/RestDeserialiseHandler.cs
diff options
context:
space:
mode:
authorJeff Ames2007-11-04 14:34:45 +0000
committerJeff Ames2007-11-04 14:34:45 +0000
commit2d1c255e8c427c8c595be455e6d7f5c4e01c99a6 (patch)
treea95f2a5085505192293603f8b0c9df23c4ac7041 /OpenSim/Framework/Servers/RestDeserialiseHandler.cs
parentApplying Teravus patch # 557. Some glue code for the updating of prim's veloc... (diff)
downloadopensim-SC_OLD-2d1c255e8c427c8c595be455e6d7f5c4e01c99a6.zip
opensim-SC_OLD-2d1c255e8c427c8c595be455e6d7f5c4e01c99a6.tar.gz
opensim-SC_OLD-2d1c255e8c427c8c595be455e6d7f5c4e01c99a6.tar.bz2
opensim-SC_OLD-2d1c255e8c427c8c595be455e6d7f5c4e01c99a6.tar.xz
normalized line endings
Diffstat (limited to 'OpenSim/Framework/Servers/RestDeserialiseHandler.cs')
-rw-r--r--OpenSim/Framework/Servers/RestDeserialiseHandler.cs74
1 files changed, 37 insertions, 37 deletions
diff --git a/OpenSim/Framework/Servers/RestDeserialiseHandler.cs b/OpenSim/Framework/Servers/RestDeserialiseHandler.cs
index adf5c3f..a47d3d3 100644
--- a/OpenSim/Framework/Servers/RestDeserialiseHandler.cs
+++ b/OpenSim/Framework/Servers/RestDeserialiseHandler.cs
@@ -1,38 +1,38 @@
1using System.IO; 1using System.IO;
2using System.Xml; 2using System.Xml;
3using System.Xml.Serialization; 3using System.Xml.Serialization;
4 4
5namespace OpenSim.Framework.Servers 5namespace OpenSim.Framework.Servers
6{ 6{
7 public delegate TResponse RestDeserialiseMethod<TRequest, TResponse>(TRequest request); 7 public delegate TResponse RestDeserialiseMethod<TRequest, TResponse>(TRequest request);
8 8
9 public class RestDeserialisehandler<TRequest, TResponse> : BaseRequestHandler, IStreamHandler 9 public class RestDeserialisehandler<TRequest, TResponse> : BaseRequestHandler, IStreamHandler
10 where TRequest : new() 10 where TRequest : new()
11 { 11 {
12 private RestDeserialiseMethod<TRequest, TResponse> m_method; 12 private RestDeserialiseMethod<TRequest, TResponse> m_method;
13 13
14 public RestDeserialisehandler(string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method) 14 public RestDeserialisehandler(string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method)
15 : base(httpMethod, path) 15 : base(httpMethod, path)
16 { 16 {
17 m_method = method; 17 m_method = method;
18 } 18 }
19 19
20 public void Handle(string path, Stream request, Stream responseStream) 20 public void Handle(string path, Stream request, Stream responseStream)
21 { 21 {
22 TRequest deserial; 22 TRequest deserial;
23 using (XmlTextReader xmlReader = new XmlTextReader(request)) 23 using (XmlTextReader xmlReader = new XmlTextReader(request))
24 { 24 {
25 XmlSerializer deserializer = new XmlSerializer(typeof (TRequest)); 25 XmlSerializer deserializer = new XmlSerializer(typeof (TRequest));
26 deserial = (TRequest) deserializer.Deserialize(xmlReader); 26 deserial = (TRequest) deserializer.Deserialize(xmlReader);
27 } 27 }
28 28
29 TResponse response = m_method(deserial); 29 TResponse response = m_method(deserial);
30 30
31 using (XmlWriter xmlWriter = XmlTextWriter.Create(responseStream)) 31 using (XmlWriter xmlWriter = XmlTextWriter.Create(responseStream))
32 { 32 {
33 XmlSerializer serializer = new XmlSerializer(typeof (TResponse)); 33 XmlSerializer serializer = new XmlSerializer(typeof (TResponse));
34 serializer.Serialize(xmlWriter, response); 34 serializer.Serialize(xmlWriter, response);
35 } 35 }
36 } 36 }
37 } 37 }
38} \ No newline at end of file 38} \ No newline at end of file