aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseStreamHandler.cs
diff options
context:
space:
mode:
authorlbsa712007-07-04 14:12:32 +0000
committerlbsa712007-07-04 14:12:32 +0000
commit6a2588454a1ac4bb484ad0b9ee648e9ac156f8db (patch)
treefd4e0d33f65e36365d15d991f95d323e6d15e8b1 /OpenSim/Framework/Servers/BaseStreamHandler.cs
parent* Added StreamHandler support (diff)
downloadopensim-SC_OLD-6a2588454a1ac4bb484ad0b9ee648e9ac156f8db.zip
opensim-SC_OLD-6a2588454a1ac4bb484ad0b9ee648e9ac156f8db.tar.gz
opensim-SC_OLD-6a2588454a1ac4bb484ad0b9ee648e9ac156f8db.tar.bz2
opensim-SC_OLD-6a2588454a1ac4bb484ad0b9ee648e9ac156f8db.tar.xz
* Removed AssetHttpServer, using BaseHttpServer instead
* Removed legacy REST handling * Created two custom IStreamHandlers for asset up/download * Removed quite a lot of double and triple encodings, trying to work towards binary only and direct write into storage. * Introduced BaseStreamHandler with GetParam() and some other goodies
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/BaseStreamHandler.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/BaseStreamHandler.cs b/OpenSim/Framework/Servers/BaseStreamHandler.cs
new file mode 100644
index 0000000..95e9707
--- /dev/null
+++ b/OpenSim/Framework/Servers/BaseStreamHandler.cs
@@ -0,0 +1,40 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.IO;
5
6namespace OpenSim.Framework.Servers
7{
8 public abstract class BaseStreamHandler : IStreamHandler
9 {
10 public string ContentType
11 {
12 get { return "application/xml"; }
13 }
14
15 private string m_httpMethod;
16 public string HttpMethod
17 {
18 get { return m_httpMethod; }
19 }
20
21 private string m_path;
22 public string Path
23 {
24 get { return m_path; }
25 }
26
27 protected string GetParam( string path )
28 {
29 return path.Substring( m_path.Length );
30 }
31
32 public abstract byte[] Handle(string path, Stream request);
33
34 protected BaseStreamHandler(string path, string httpMethod )
35 {
36 m_httpMethod = httpMethod;
37 m_path = path;
38 }
39 }
40}