From 6a2588454a1ac4bb484ad0b9ee648e9ac156f8db Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 4 Jul 2007 14:12:32 +0000 Subject: * 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 --- OpenSim/Framework/Servers/BaseStreamHandler.cs | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 OpenSim/Framework/Servers/BaseStreamHandler.cs (limited to 'OpenSim/Framework/Servers/BaseStreamHandler.cs') 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 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace OpenSim.Framework.Servers +{ + public abstract class BaseStreamHandler : IStreamHandler + { + public string ContentType + { + get { return "application/xml"; } + } + + private string m_httpMethod; + public string HttpMethod + { + get { return m_httpMethod; } + } + + private string m_path; + public string Path + { + get { return m_path; } + } + + protected string GetParam( string path ) + { + return path.Substring( m_path.Length ); + } + + public abstract byte[] Handle(string path, Stream request); + + protected BaseStreamHandler(string path, string httpMethod ) + { + m_httpMethod = httpMethod; + m_path = path; + } + } +} -- cgit v1.1