BaseStreamHandler.cs 922 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.IO;
  5. namespace OpenSim.Framework.Servers
  6. {
  7. public abstract class BaseStreamHandler : IStreamHandler
  8. {
  9. virtual public string ContentType
  10. {
  11. get { return "application/xml"; }
  12. }
  13. private string m_httpMethod;
  14. virtual public string HttpMethod
  15. {
  16. get { return m_httpMethod; }
  17. }
  18. private string m_path;
  19. virtual public string Path
  20. {
  21. get { return m_path; }
  22. }
  23. protected string GetParam( string path )
  24. {
  25. return path.Substring( m_path.Length );
  26. }
  27. public abstract byte[] Handle(string path, Stream request);
  28. protected BaseStreamHandler(string httpMethod, string path)
  29. {
  30. m_httpMethod = httpMethod;
  31. m_path = path;
  32. }
  33. }
  34. }