aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseStreamHandler.cs
blob: 95e9707ff5961626e99fc303dd6f4d15b5163bac (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
    {
        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;
        }
    }
}