aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseStreamHandler.cs
blob: 0c714e64fe095d977def383f807b349f5f770320 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace OpenSim.Framework.Servers
{
    public abstract class BaseStreamHandler : IStreamHandler
    {
        virtual public string ContentType
        {
            get { return "application/xml"; }
        }

        private string m_httpMethod;
        virtual public string HttpMethod
        {
            get { return m_httpMethod; }
        }

        private string m_path;
        virtual 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 httpMethod, string path)
        {
            m_httpMethod = httpMethod;
            m_path = path;
        }
    }
}