mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 12:25:42 +08:00
Implement the "delete" path for assets. Adds a new option to allow remote asset deletion in robust handler.
This commit is contained in:
@@ -48,5 +48,6 @@ namespace OpenSim.Data
|
||||
public abstract void Initialise(string connect);
|
||||
public abstract void Initialise();
|
||||
public abstract void Dispose();
|
||||
public abstract bool Delete(string id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace OpenSim.Data
|
||||
bool ExistsAsset(UUID uuid);
|
||||
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
|
||||
void Initialise(string connect);
|
||||
bool Delete(string id);
|
||||
}
|
||||
|
||||
public class AssetDataInitialiser : PluginInitialiserBase
|
||||
|
||||
@@ -322,6 +322,10 @@ namespace OpenSim.Data.MSSQL
|
||||
return retList;
|
||||
}
|
||||
|
||||
public override bool Delete(string id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,6 +338,24 @@ namespace OpenSim.Data.MySQL
|
||||
return retList;
|
||||
}
|
||||
|
||||
public override bool Delete(string id)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id");
|
||||
cmd.Parameters.AddWithValue("?id", id);
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
cmd.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,6 +338,11 @@ namespace OpenSim.Data.SQLite
|
||||
get { return "SQLite Asset storage engine"; }
|
||||
}
|
||||
|
||||
public override bool Delete(string id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,6 +338,10 @@ namespace OpenSim.Data.SQLiteLegacy
|
||||
get { return "SQLite Asset storage engine"; }
|
||||
}
|
||||
|
||||
public override bool Delete(string id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user