aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs56
1 files changed, 28 insertions, 28 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
index 2996030..3475d32 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
@@ -212,12 +212,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
212 212
213 rdata.writer.WriteStartElement(String.Empty,"Asset",String.Empty); 213 rdata.writer.WriteStartElement(String.Empty,"Asset",String.Empty);
214 214
215 rdata.writer.WriteAttributeString("id", asset.Metadata.ID); 215 rdata.writer.WriteAttributeString("id", asset.ID);
216 rdata.writer.WriteAttributeString("name", asset.Metadata.Name); 216 rdata.writer.WriteAttributeString("name", asset.Name);
217 rdata.writer.WriteAttributeString("desc", asset.Metadata.Description); 217 rdata.writer.WriteAttributeString("desc", asset.Description);
218 rdata.writer.WriteAttributeString("type", asset.Metadata.Type.ToString()); 218 rdata.writer.WriteAttributeString("type", asset.Type.ToString());
219 rdata.writer.WriteAttributeString("local", asset.Metadata.Local.ToString()); 219 rdata.writer.WriteAttributeString("local", asset.Local.ToString());
220 rdata.writer.WriteAttributeString("temporary", asset.Metadata.Temporary.ToString()); 220 rdata.writer.WriteAttributeString("temporary", asset.Temporary.ToString());
221 221
222 rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length); 222 rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length);
223 223
@@ -268,19 +268,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
268 modified = (asset != null); 268 modified = (asset != null);
269 created = !modified; 269 created = !modified;
270 270
271 asset = new AssetBase(); 271 asset = new AssetBase();
272 asset.Metadata.FullID = uuid; 272 asset.FullID = uuid;
273 asset.Metadata.Name = xml.GetAttribute("name"); 273 asset.Name = xml.GetAttribute("name");
274 asset.Metadata.Description = xml.GetAttribute("desc"); 274 asset.Description = xml.GetAttribute("desc");
275 asset.Metadata.Type = SByte.Parse(xml.GetAttribute("type")); 275 asset.Type = SByte.Parse(xml.GetAttribute("type"));
276 asset.Metadata.Local = Int32.Parse(xml.GetAttribute("local")) != 0; 276 asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
277 asset.Metadata.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; 277 asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
278 asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); 278 asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
279 279
280 if (asset.Metadata.ID != rdata.Parameters[0]) 280 if (asset.ID != rdata.Parameters[0])
281 { 281 {
282 Rest.Log.WarnFormat("{0} URI and payload disagree on UUID U:{1} vs P:{2}", 282 Rest.Log.WarnFormat("{0} URI and payload disagree on UUID U:{1} vs P:{2}",
283 MsgId, rdata.Parameters[0], asset.Metadata.ID); 283 MsgId, rdata.Parameters[0], asset.ID);
284 } 284 }
285 285
286 Rest.AssetServices.AddAsset(asset); 286 Rest.AssetServices.AddAsset(asset);
@@ -294,14 +294,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
294 294
295 if (created) 295 if (created)
296 { 296 {
297 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); 297 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
298 rdata.Complete(Rest.HttpStatusCodeCreated); 298 rdata.Complete(Rest.HttpStatusCodeCreated);
299 } 299 }
300 else 300 else
301 { 301 {
302 if (modified) 302 if (modified)
303 { 303 {
304 rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); 304 rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
305 rdata.Complete(Rest.HttpStatusCodeOK); 305 rdata.Complete(Rest.HttpStatusCodeOK);
306 } 306 }
307 else 307 else
@@ -348,27 +348,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
348 modified = (asset != null); 348 modified = (asset != null);
349 created = !modified; 349 created = !modified;
350 350
351 asset = new AssetBase(); 351 asset = new AssetBase();
352 asset.Metadata.FullID = uuid; 352 asset.FullID = uuid;
353 asset.Metadata.Name = xml.GetAttribute("name"); 353 asset.Name = xml.GetAttribute("name");
354 asset.Metadata.Description = xml.GetAttribute("desc"); 354 asset.Description = xml.GetAttribute("desc");
355 asset.Metadata.Type = SByte.Parse(xml.GetAttribute("type")); 355 asset.Type = SByte.Parse(xml.GetAttribute("type"));
356 asset.Metadata.Local = Int32.Parse(xml.GetAttribute("local")) != 0; 356 asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
357 asset.Metadata.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; 357 asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
358 asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); 358 asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
359 359
360 Rest.AssetServices.AddAsset(asset); 360 Rest.AssetServices.AddAsset(asset);
361 361
362 if (created) 362 if (created)
363 { 363 {
364 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); 364 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
365 rdata.Complete(Rest.HttpStatusCodeCreated); 365 rdata.Complete(Rest.HttpStatusCodeCreated);
366 } 366 }
367 else 367 else
368 { 368 {
369 if (modified) 369 if (modified)
370 { 370 {
371 rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); 371 rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
372 rdata.Complete(Rest.HttpStatusCodeOK); 372 rdata.Complete(Rest.HttpStatusCodeOK);
373 } 373 }
374 else 374 else