.NET Server

Upgrading to WebDAV Server Engine .NET v9

In this article

Upgrading to WebDAV Server Engine .NET v9

The v9 Engine is redesigned to provide G Suite editing capabilities as well as to achieve integration of WebDAV and G Suite features. After upgrading to v9 you can add G Suite editing without significant programming efforts or reprogramming your existing WebDAV implementation.

What Has Changed in v9

v9 Engine interfaces are redesigned to provide common base for building WebDAV and G Suite editing. The new namespace, provided in v9 - ITHit.Server contains interfaces and classes that are common for WebDAV and G Suite Editing, located in ITHit.Server module on NuGet. Interfaces specific to G Suite editing are provided in ITHit.GSuite.Server namespace located in ITHit.GSuite.Server module on NuGet

 V3-v8 EntityCorresponding V9 Entity
Class - EngineAsync<THierarchyItem> - provides functionality, common for WebDAV Engine and G Suite Engine. Processes request and generates a response.
Class ContextAsync<THierarchyItemAsync> - base context class for WebDAV and G Suite contexts.
Class GSuiteEngineAsync - Provides editing in Google G Suite online.
Class DavRequest Replaced by ITHit.Server.RequestAsync
Class DavResponse Replaced by ITHit.Server.ResponseAsync
Property DavRequest.ClientLockTokens Replaced by GetClientLockTokens() extension method for RequestAsync class. Located in ITHit.WebDAV.Server.Class2 namespace.
Interface ILogger Moved to ITHit.Server
Class DavEngineAsync Now inherits from EngineAsync<IHierarchyItemAsync>
Interface IHierarchyItemAsync Now inherits from IHierarchyItemBaseAsync 
Interface IMethodHandlerAsync Replaced with IMethodHandlerAsync<THierarchyItemAsync> and moved to ITHit.Server.Extensibility
Class DavContextBaseAsync Replaced with ContextAsync<THierarchyItemAsync>.
Class DavContextCoreBaseAsync Replaced with ContextCoreAsync<IHierarchyItemAsync>. Located in ITHit.Server.Core module.
Class DavContextWebBaseAsync Replaced with ContextWebAsync<IHierarchyItemAsync>. Located in ITHit.Server.Web module.
Class DavContextHttpListenerBaseAsync Replaced with ContextHttpListenerAsync<IHierarchyItemAsync>. Located in ITHit.Server.HttpListener module.
Class DavContextOwinBaseAsync Replaced with ContextOwinAsync<IHierarchyItemAsync>. Located in ITHit.Server.Owin module.
Class DavContextWebListenerBaseAsync Replaced with ContextWebListenerAsync<IHierarchyItemAsync>. Located in ITHit.Server.WebListener module.

Upgrading Your Server Code

To upgrade your existing WebDAV implementation to v9 follow these steps:

  1. Update your ITHit.WebDAV.Server module reference. Typically you will download the latest build from NuGet. Otherwise, in case you are adding a reference to your project from the file system, make sure to add the new ITHit.Server.dll module reference.
  2. Replace DavRequest.ClientLockTokens property call with GetClientLockTokens() extension method, located in DavRequestExtensions class in ITHit.WebDAV.Server.Class2 namespace:
    IList<string> clientLockTokens = context.Request.GetClientLockTokens();
  3. Add 'using' directive to all files where ILogger interface is used:
    using ITHit.Server;
     such as DavEngineMiddleware.cs/vbDavEngineCore.cs/vbDavContext.cs/vb, etc.
  4. Replace IMethodHandlerAsync with IMethodHandlerAsync<IHierarchyItemAsync> interface. Add 'using' directive for ITHit.Server.Extensibility namespace. Update the ProcessRequestAsync() method signature, replacing DavContextBaseAsync class with ContextAsync<THierarchyItemAsync> class:
    using ITHit.Server;
    using ITHit.Server.Extensibility;
    
    internal class MyCustomGetHandler : IMethodHandlerAsync<IHierarchyItemAsync>
    {
    	public IMethodHandlerAsync<IHierarchyItemAsync> OriginalHandler { get; set; }
    	...
    	public async Task ProcessRequestAsync(ContextAsync<IHierarchyItemAsync> context, IHierarchyItemAsync item)
    	{
    	...
    	}
    ...
    }
    
  5. Replace DavContextBaseAsync class with ContextAsync<IHierarchyItemAsync> class. Add 'using' directive for ITHit.Server namespace.
  6. Replace context classes that are specific to your project. You will replace your DavContext*BaseAsync class with Context*Async<IHierarchyItemAsync> class and add a reference to a module where the new class is located. See the table above in this article about where new contexts are located. For example to in case of ASP.NET Core project you will replace DavContextCoreBaseAsync class with ContextCoreAsync<IHierarchyItemAsync> class. Add a reference to ITHit.Server.Core module to your project. 

See Also:

Next Article:

Upgrading to WebDAV Server Engine .NET v8