aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2010-05-09 18:02:36 +0100
committerMelanie2010-05-09 18:02:36 +0100
commitbc6995f92123ff29fdfd6f811d3d252d99284527 (patch)
tree0be2ef533920023b528739f40e5320a7932a4a5e /OpenSim
parentImplement the "delete" path for assets. Adds a new option to allow remote ass... (diff)
downloadopensim-SC-bc6995f92123ff29fdfd6f811d3d252d99284527.zip
opensim-SC-bc6995f92123ff29fdfd6f811d3d252d99284527.tar.gz
opensim-SC-bc6995f92123ff29fdfd6f811d3d252d99284527.tar.bz2
opensim-SC-bc6995f92123ff29fdfd6f811d3d252d99284527.tar.xz
Add Delete handler to SQLite (NG)
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs31
1 files changed, 16 insertions, 15 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 9b938fa..2783ba1 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -208,20 +208,6 @@ namespace OpenSim.Data.SQLite
208 } 208 }
209 209
210 /// <summary> 210 /// <summary>
211 /// Delete an asset from database
212 /// </summary>
213 /// <param name="uuid"></param>
214 public void DeleteAsset(UUID uuid)
215 {
216 using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn))
217 {
218 cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString()));
219
220 cmd.ExecuteNonQuery();
221 }
222 }
223
224 /// <summary>
225 /// 211 ///
226 /// </summary> 212 /// </summary>
227 /// <param name="row"></param> 213 /// <param name="row"></param>
@@ -340,7 +326,22 @@ namespace OpenSim.Data.SQLite
340 326
341 public override bool Delete(string id) 327 public override bool Delete(string id)
342 { 328 {
343 return false; 329 UUID assetID;
330
331 if (!UUID.TryParse(id, out assetID))
332 return false;
333
334 lock (this)
335 {
336 using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn))
337 {
338 cmd.Parameters.Add(new SqliteParameter(":UUID", assetID.ToString()));
339
340 cmd.ExecuteNonQuery();
341 }
342 }
343
344 return true;
344 } 345 }
345 346
346 #endregion 347 #endregion