From 978b8af77702f1e2129ad18e247273a8dd20778d Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Thu, 18 Sep 2008 15:49:52 +0000 Subject: Adds REST interface for setting avatar appearance. cleans up a couple of places in the REST inventory code. --- .../Rest/Inventory/RestAssetServices.cs | 35 +++++++++++++++------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs') 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 if (!qPrefix.StartsWith(Rest.UrlPathSeparator)) { - qPrefix = Rest.Prefix + Rest.UrlPathSeparator + qPrefix; + Rest.Log.InfoFormat("{0} Prefixing domain name ({1})", MsgId, qPrefix); + qPrefix = String.Format("{0}{1}{2}", Rest.Prefix, Rest.UrlPathSeparator, qPrefix); + Rest.Log.InfoFormat("{0} Fully qualified domain name is <{1}>", MsgId, qPrefix); } // Register interface using the fully-qualified prefix @@ -85,7 +87,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public void Close() { enabled = false; - Rest.Log.InfoFormat("{0} Asset services closing down", MsgId); + Rest.Log.InfoFormat("{0} Asset services ({1}) closing down", MsgId, qPrefix); } // Properties @@ -110,7 +112,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory AssetRequestData rdata = (AssetRequestData) rparm; - Rest.Log.DebugFormat("{0} REST Asset handler ENTRY", MsgId); + Rest.Log.DebugFormat("{0} REST Asset handler ({1}) ENTRY", MsgId, qPrefix); // Now that we know this is a serious attempt to // access inventory data, we should find out who @@ -184,15 +186,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory #endregion Interface + /// + /// The only parameter we recognize is a UUID.If an asset with this identification is + /// found, it's content, base-64 encoded, is returned to the client. + /// + private void DoGet(AssetRequestData rdata) { bool istexture = false; Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method); - // The only parameter we accept is an UUID for - // the asset - if (rdata.Parameters.Length == 1) { UUID uuid = new UUID(rdata.Parameters[0]); @@ -226,15 +230,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } rdata.Complete(); - rdata.Respond("Asset " + rdata.method + ": Normal completion"); + rdata.Respond(String.Format("Asset <{0}> : Normal completion", rdata.method)); + } + /// + /// The only parameter we recognize is a UUID. The enclosed asset data (base-64 encoded) + /// is decoded and stored in the database, identified by the supplied UUID. + /// + private void DoPut(AssetRequestData rdata) { - Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method); - // The only parameter we accept is an UUID for - // the asset + Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method); if (rdata.Parameters.Length == 1) { @@ -265,9 +273,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } rdata.Complete(); - rdata.Respond("Asset " + rdata.method + ": Normal completion"); + rdata.Respond(String.Format("Asset <{0}>: Normal completion", rdata.method)); + } + /// + /// Asset processing has no special data area requirements. + /// + internal class AssetRequestData : RequestData { internal AssetRequestData(OSHttpRequest request, OSHttpResponse response, string prefix) -- cgit v1.1