aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
diff options
context:
space:
mode:
authorDr Scofield2008-09-18 15:49:52 +0000
committerDr Scofield2008-09-18 15:49:52 +0000
commit978b8af77702f1e2129ad18e247273a8dd20778d (patch)
tree423d9f85844f4b5d79044fc95e1973369aa1c626 /OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
parentadds support to delete a region completely and offers that (diff)
downloadopensim-SC-978b8af77702f1e2129ad18e247273a8dd20778d.zip
opensim-SC-978b8af77702f1e2129ad18e247273a8dd20778d.tar.gz
opensim-SC-978b8af77702f1e2129ad18e247273a8dd20778d.tar.bz2
opensim-SC-978b8af77702f1e2129ad18e247273a8dd20778d.tar.xz
Adds REST interface for setting avatar appearance. cleans up a couple
of places in the REST inventory code.
Diffstat (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs35
1 files changed, 24 insertions, 11 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
index 9d34b4e..5fd8015 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs
@@ -57,7 +57,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
57 57
58 if (!qPrefix.StartsWith(Rest.UrlPathSeparator)) 58 if (!qPrefix.StartsWith(Rest.UrlPathSeparator))
59 { 59 {
60 qPrefix = Rest.Prefix + Rest.UrlPathSeparator + qPrefix; 60 Rest.Log.InfoFormat("{0} Prefixing domain name ({1})", MsgId, qPrefix);
61 qPrefix = String.Format("{0}{1}{2}", Rest.Prefix, Rest.UrlPathSeparator, qPrefix);
62 Rest.Log.InfoFormat("{0} Fully qualified domain name is <{1}>", MsgId, qPrefix);
61 } 63 }
62 64
63 // Register interface using the fully-qualified prefix 65 // Register interface using the fully-qualified prefix
@@ -85,7 +87,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
85 public void Close() 87 public void Close()
86 { 88 {
87 enabled = false; 89 enabled = false;
88 Rest.Log.InfoFormat("{0} Asset services closing down", MsgId); 90 Rest.Log.InfoFormat("{0} Asset services ({1}) closing down", MsgId, qPrefix);
89 } 91 }
90 92
91 // Properties 93 // Properties
@@ -110,7 +112,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
110 112
111 AssetRequestData rdata = (AssetRequestData) rparm; 113 AssetRequestData rdata = (AssetRequestData) rparm;
112 114
113 Rest.Log.DebugFormat("{0} REST Asset handler ENTRY", MsgId); 115 Rest.Log.DebugFormat("{0} REST Asset handler ({1}) ENTRY", MsgId, qPrefix);
114 116
115 // Now that we know this is a serious attempt to 117 // Now that we know this is a serious attempt to
116 // access inventory data, we should find out who 118 // access inventory data, we should find out who
@@ -184,15 +186,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
184 186
185 #endregion Interface 187 #endregion Interface
186 188
189 /// <summary>
190 /// The only parameter we recognize is a UUID.If an asset with this identification is
191 /// found, it's content, base-64 encoded, is returned to the client.
192 /// </summary>
193
187 private void DoGet(AssetRequestData rdata) 194 private void DoGet(AssetRequestData rdata)
188 { 195 {
189 bool istexture = false; 196 bool istexture = false;
190 197
191 Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method); 198 Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method);
192 199
193 // The only parameter we accept is an UUID for
194 // the asset
195
196 if (rdata.Parameters.Length == 1) 200 if (rdata.Parameters.Length == 1)
197 { 201 {
198 UUID uuid = new UUID(rdata.Parameters[0]); 202 UUID uuid = new UUID(rdata.Parameters[0]);
@@ -226,15 +230,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
226 } 230 }
227 231
228 rdata.Complete(); 232 rdata.Complete();
229 rdata.Respond("Asset " + rdata.method + ": Normal completion"); 233 rdata.Respond(String.Format("Asset <{0}> : Normal completion", rdata.method));
234
230 } 235 }
231 236
237 /// <summary>
238 /// The only parameter we recognize is a UUID. The enclosed asset data (base-64 encoded)
239 /// is decoded and stored in the database, identified by the supplied UUID.
240 /// </summary>
241
232 private void DoPut(AssetRequestData rdata) 242 private void DoPut(AssetRequestData rdata)
233 { 243 {
234 Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method);
235 244
236 // The only parameter we accept is an UUID for 245 Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method);
237 // the asset
238 246
239 if (rdata.Parameters.Length == 1) 247 if (rdata.Parameters.Length == 1)
240 { 248 {
@@ -265,9 +273,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
265 } 273 }
266 274
267 rdata.Complete(); 275 rdata.Complete();
268 rdata.Respond("Asset " + rdata.method + ": Normal completion"); 276 rdata.Respond(String.Format("Asset <{0}>: Normal completion", rdata.method));
277
269 } 278 }
270 279
280 /// <summary>
281 /// Asset processing has no special data area requirements.
282 /// </summary>
283
271 internal class AssetRequestData : RequestData 284 internal class AssetRequestData : RequestData
272 { 285 {
273 internal AssetRequestData(OSHttpRequest request, OSHttpResponse response, string prefix) 286 internal AssetRequestData(OSHttpRequest request, OSHttpResponse response, string prefix)