diff options
author | Melanie | 2010-05-09 17:56:52 +0100 |
---|---|---|
committer | Melanie | 2010-05-09 17:56:52 +0100 |
commit | 60357d3778c95a47481f790803b7af39c70cde9c (patch) | |
tree | cc49f9da3a6907c32d3e8de31c1d811b11477d30 /OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs | |
parent | Add a field asset_flags and a corresponding enum to the asset database. This (diff) | |
download | opensim-SC-60357d3778c95a47481f790803b7af39c70cde9c.zip opensim-SC-60357d3778c95a47481f790803b7af39c70cde9c.tar.gz opensim-SC-60357d3778c95a47481f790803b7af39c70cde9c.tar.bz2 opensim-SC-60357d3778c95a47481f790803b7af39c70cde9c.tar.xz |
Implement the "delete" path for assets. Adds a new option to allow remote asset deletion in robust handler.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs | 8 |
1 files changed, 5 insertions, 3 deletions
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 | |||
47 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | private IAssetService m_AssetService; | 49 | private IAssetService m_AssetService; |
50 | protected bool m_allowDelete; | ||
50 | 51 | ||
51 | public AssetServerDeleteHandler(IAssetService service) : | 52 | public AssetServerDeleteHandler(IAssetService service, bool allowDelete) : |
52 | base("DELETE", "/assets") | 53 | base("DELETE", "/assets") |
53 | { | 54 | { |
54 | m_AssetService = service; | 55 | m_AssetService = service; |
56 | m_allowDelete = allowDelete; | ||
55 | } | 57 | } |
56 | 58 | ||
57 | public override byte[] Handle(string path, Stream request, | 59 | public override byte[] Handle(string path, Stream request, |
@@ -61,9 +63,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
61 | 63 | ||
62 | string[] p = SplitParams(path); | 64 | string[] p = SplitParams(path); |
63 | 65 | ||
64 | if (p.Length > 0) | 66 | if (p.Length > 0 && m_allowDelete) |
65 | { | 67 | { |
66 | // result = m_AssetService.Delete(p[0]); | 68 | result = m_AssetService.Delete(p[0]); |
67 | } | 69 | } |
68 | 70 | ||
69 | XmlSerializer xs = new XmlSerializer(typeof(bool)); | 71 | XmlSerializer xs = new XmlSerializer(typeof(bool)); |