.NET Server

How to Upgrade to WebDAV Server Engine V2

In this article

How to Upgrade to WebDAV Server Engine V2

How to Upgrade to V2.1

Update your CreateResource and ConvertToResource Implementations

The signature of IFolder.CreateResource and ILockNull.ConvertToResource methods have changed. The content is no more passed to this methods, instead after calling these methods Engine will call IResource.SaveFromStream (or IResumableUpload.SaveFromStream if you implement resumable upload).

Use new Overloaded Engine.Run Methods

This version provides 2 new overloaded Engine.Run methods designed for use in IIS/ASP.NET and HttpListener. It is recommended to use this method instead of implementing request and response classes:
 - If you host server in HttpListener use Engine.Run (HttpListenerContext, HttpListenerPrefixCollection)
 - If you host server in IIS / ASP. NET use Engine.Run(HttpContext)

Version Control Changes

The v2.1 puts resource under version control after item is created if Engine.AutoPutUnderVersionControl is true. Previously item was put under version control only when content or properties of an existing item was updated and Engine.AutoPutUnderVersionControl was true.

How to Upgrade to V2.0

Upgrade to .NET 2.0

The new version requires .NET Framework 2.0 and will not run on .NET 1.1.

Implement IHierarchyIten.Path Property

The new version of WebDAV Server Engine provides new property called Path in IHierarchyItem interface. The Path property represents a unique item path in the repository. The URL returned by Path property is relative to storage root. If your server root is located at ‘http://example.webdavsystem.com:8080/myserver/’ and the item URL is ‘http://example.webdavsystem.com:8080/myserver/myfolder/myitem.docPath property implementation must return ‘myfolder/myitem.doc’. To calculate the entire item URL, the engine will call myfolder/myitem.doc’. To calculate the entire item URL, the engine will call Request.ApplicationPath property and attach it to URL returned by Path property.

Implement Request.UserAgent Property

Request class now requires new property UserAgent to be implemented. This property was added to Request class because of the bug in HttpListener implementation. HttpListener removes User-Agent header (and only this header) from the list returned by HttpListenerRequest.Headers. However, this property is still available via HttpListenerRequest.UserAgent property.

Implement IHierarchyItem.GetPropertyNames

The GetPropertyNames provides to WebDAV client the ability to request all property names without values. In your GetPropertyNames implementation, you will create an array of properties and return it via props parameter. Note that most WebDAV clients including Microsoft Web Folders never use this functionality, so your GetPropertyNames implementation can just return NotAllowedResponse.


See Also

Next Article:

Creating Class 1 WebDAV Server