public BackendResponse TryCreateAsset(AssetBase asset)
        {
            BackendResponse ret;

            m_assetProvider.CreateAsset(asset);
            ret = BackendResponse.Success;

            m_server.MetricsProvider.LogAssetCreate(EXTENSION_NAME, ret, asset.FullID, asset.Data.Length, DateTime.Now);
            return(ret);
        }
        public override byte[] Handle(string path, Stream request,
                                      OSHttpRequest httpRequest, OSHttpResponse httpResponse)
        {
            string param = GetParam(path);

            UUID assetId;

            if (param.Length > 0)
            {
                UUID.TryParse(param, out assetId);
            }
            // byte[] txBuffer = new byte[4096];

            XmlSerializer xs    = new XmlSerializer(typeof(AssetBase));
            AssetBase     asset = (AssetBase)xs.Deserialize(request);

            m_log.InfoFormat("[REST]: Creating asset {0}", asset.FullID);
            m_assetProvider.CreateAsset(asset);

            return(new byte[] {});
        }
示例#3
0
文件: Main.cs 项目: boodie/Opensim2
 protected void StoreAsset(AssetBase asset)
 {
     m_assetProvider.CreateAsset(asset);
 }