From 60357d3778c95a47481f790803b7af39c70cde9c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 9 May 2010 17:56:52 +0100 Subject: Implement the "delete" path for assets. Adds a new option to allow remote asset deletion in robust handler. --- OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs') diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs index f33bb90..8014fb5 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs @@ -47,11 +47,13 @@ namespace OpenSim.Server.Handlers.Asset // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IAssetService m_AssetService; + protected bool m_allowDelete; - public AssetServerDeleteHandler(IAssetService service) : + public AssetServerDeleteHandler(IAssetService service, bool allowDelete) : base("DELETE", "/assets") { m_AssetService = service; + m_allowDelete = allowDelete; } public override byte[] Handle(string path, Stream request, @@ -61,9 +63,9 @@ namespace OpenSim.Server.Handlers.Asset string[] p = SplitParams(path); - if (p.Length > 0) + if (p.Length > 0 && m_allowDelete) { - // result = m_AssetService.Delete(p[0]); + result = m_AssetService.Delete(p[0]); } XmlSerializer xs = new XmlSerializer(typeof(bool)); -- cgit v1.1