mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
* 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
This commit is contained in:
40
OpenSim/Framework/Servers/BaseStreamHandler.cs
Normal file
40
OpenSim/Framework/Servers/BaseStreamHandler.cs
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user