using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Runtime.Serialization.Formatters.Binary;
using Sphorium.WebDAV.Server.Framework.Classes;
using Sphorium.WebDAV.Server.Framework.Resources;
using Sphorium.WebDAV.Server.Framework.BaseClasses;
using Sphorium.WebDAV.Server.Framework.Collections;
namespace Everest.CmsServices.Rfc.WebDAV{
public sealed class DavPropPatch : DavPropPatchBase
{
public DavPropPatch()
{
this.ProcessDavRequest += new DavProcessEventHandler(DavPropPatch_ProcessDavRequest);
}
private void DavPropPatch_ProcessDavRequest(object sender, EventArgs e)
{
//Check to see if we can replace the properties
// //Fake out the delete process issue by default
// DavFile _junk = new DavFile();
// _junk.FilePath = "http://www.bubba.com/nope";
//
// base.AddProcessErrorResource(_junk, DavDeleteResponseCode.Locked);
// base.AddProcessErrorResource(_junk, DavDeleteResponseCode.InsufficientStorage);
//
// return;
//Logic... if anything fails... must rollback!
var url = WebDavHelper.GetCurrentUrl(HttpApplication.Request);
base.PatchedResource = new DavFile("", url);
base.PatchedResource.LastModified = DateTime.Now;
base.PatchedResource.CreationDate = DateTime.Now;
foreach (DavProperty _property in base.RequestModifyProperties)
{
DavProperty _customProperty = base.PatchedResource.CustomProperties[_property.Name];
if (_customProperty != null)
base.PatchedResource.CustomProperties.Remove(_property.Name);
base.PatchedResource.CustomProperties.Add(_property);
}
}
}
}
|