123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using Nini.Config;
- using log4net;
- using System;
- using System.Reflection;
- using System.IO;
- using System.Net;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Xml;
- using System.Xml.Serialization;
- using OpenSim.Server.Base;
- using OpenSim.Services.Interfaces;
- using OpenSim.Framework;
- using OpenSim.Framework.Servers.HttpServer;
- namespace OpenSim.Server.Handlers.Asset
- {
- public class AssetServerDeleteHandler : BaseStreamHandler
- {
-
- private IAssetService m_AssetService;
- protected bool m_allowDelete;
- public AssetServerDeleteHandler(IAssetService service, bool allowDelete) :
- base("DELETE", "/assets")
- {
- m_AssetService = service;
- m_allowDelete = allowDelete;
- }
- public override byte[] Handle(string path, Stream request,
- OSHttpRequest httpRequest, OSHttpResponse httpResponse)
- {
- bool result = false;
- string[] p = SplitParams(path);
- if (p.Length > 0 && m_allowDelete)
- {
- result = m_AssetService.Delete(p[0]);
- }
- XmlSerializer xs = new XmlSerializer(typeof(bool));
- return ServerUtils.SerializeResult(xs, result);
- }
- }
- }
|