aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/RestStreamHandler.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-07-11 08:10:25 +0000
committerAdam Frisby2007-07-11 08:10:25 +0000
commite2ff441e31328e60c8bb1d4bb32fa4ac64f91978 (patch)
tree8405b6cef57b66a58f31a24c859846085d0b81f7 /OpenSim/Framework/Servers/RestStreamHandler.cs
parent* Wiping trunk in prep for Sugilite (diff)
parent* Applying dalien's patches from bug#177 and #179 (diff)
downloadopensim-SC-e2ff441e31328e60c8bb1d4bb32fa4ac64f91978.zip
opensim-SC-e2ff441e31328e60c8bb1d4bb32fa4ac64f91978.tar.gz
opensim-SC-e2ff441e31328e60c8bb1d4bb32fa4ac64f91978.tar.bz2
opensim-SC-e2ff441e31328e60c8bb1d4bb32fa4ac64f91978.tar.xz
* Bringing Sugilite in to trunk
Diffstat (limited to 'OpenSim/Framework/Servers/RestStreamHandler.cs')
-rw-r--r--OpenSim/Framework/Servers/RestStreamHandler.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/RestStreamHandler.cs b/OpenSim/Framework/Servers/RestStreamHandler.cs
new file mode 100644
index 0000000..1b3b41c
--- /dev/null
+++ b/OpenSim/Framework/Servers/RestStreamHandler.cs
@@ -0,0 +1,31 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.IO;
5
6namespace OpenSim.Framework.Servers
7{
8 public class RestStreamHandler : BaseStreamHandler
9 {
10 RestMethod m_restMethod;
11
12 override public byte[] Handle(string path, Stream request )
13 {
14 Encoding encoding = Encoding.UTF8;
15 StreamReader streamReader = new StreamReader(request, encoding);
16
17 string requestBody = streamReader.ReadToEnd();
18 streamReader.Close();
19
20 string param = GetParam(path);
21 string responseString = m_restMethod(requestBody, path, param );
22
23 return Encoding.UTF8.GetBytes(responseString);
24 }
25
26 public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base( httpMethod, path )
27 {
28 m_restMethod = restMethod;
29 }
30 }
31}