Upgrading Your Server Implementation to WebDAV Server Engine .NET v4

IT Hit WebDAV Server Engine v4 provides asynchronous Engine implementation and new asynchronous interfaces that follow the Task-based Asynchronous Pattern (TAP). The new async implementation and interfaces are located in .NET 4.5 ITHit.WebDAV.Server.dll that is by default installed to C:\Program Files (x86)\IT Hit\WebDAV Server Engine\v4.x.x\Server\bin\.Net 4.5\ folder.

The Engine v4 also provides synchronous version. Even though the synchronous version is compiled for .NET 4.0 and .NET 3.5 you can run it in .NET 4.5 and later environments. The synchronous ITHit.WebDAV.Server.dll could be found in \Server\bin\.Net 4.0\ and \Server\bin\.Net 3.5\ folders. In case you wish to use the Engine v4 synchronous version, minimum changes in your code is required in CalDAV/CardDAV and Versioning interfaces, see below.

How to Migrate Your Code to New Async Interfaces

All interfaces methods in v4 are made asynchronous and follow TAP naming convention. To migrate your code to async interfaces you will need to add ‘Async’ suffix to all Engine interfaces methods and change the return type of the method. You will also rename all Engine interfaces in your code adding ‘Async’ suffix. 

To migrate your code to the new v4 async interfaces follow the steps below:

  1. Change the reference to ITHit.WebDAV.Server.dll in your project. Remove the old reference and add the new one to .NET 4.5 ITHit.WebDAV.Server.dll located in  \Server\bin\.Net 4.5\
  2. Add 'Async' suffix to all Engine interfaces. For example replace IFile with IFileAsync.
  3. Add 'Async' suffix to all interface methods implementations. For example replace CreateFile method with CreateFileAsync.
  4. Change the return type of all methods implementations to be async Task<Type>. For example you will change
    IFile CreateFile() to async Task<IFile> CreateFileAsync(). Or void CreateFolder() to async Task CreateFolderAsync().
  5. Use DevEngineAsync class instead of DevEngine and call RunAsync instead of Run in your code.

CalDAV and CardDAV Interfaces Changes

  • CalDAV and CardDAV implementation can now process calendar-multiget and addressbook-multiget requests more efficiently. IAddressbookFolder and ICalendarFolder interfaces and their async counterparts now provide new MultiGet method that return a list of IHierarchyItems based on the list of item urls requested by the CalDAV or CardDAV client.
  • Unlike regular WebDAV server that is used for file storage, the CalDAV/CardDAV server debugging typically requires logging of vCard and iCalendar content when reading and writing contacts and calendar items in GET and PUT requests. The logging of PUT and GET requests content is disabled by default to reduce the log size in case large files upload and download. Now logging of PUT and GET requests content can be enabled by setting ILogger.LogFlags property:
    logger.LogFlags = LogFlagsEnum.LogGetResponseBody | LogFlagsEnum.LogPutRequestBody;
  • ICalendarDiscoveryAsync.CalendarHomeSet and IAddressbookDiscovery.AddressbookHomeSet properties are replaced with GetCalendarHomeSet and GetAddressbookHomeSet methods and their asynchronous counterparts (in case of asynchronous Engine version).

Versioning Interfaces Changes

IVersion.VersionableItem property is replaced with GetVersionableItem method and its asynchronous counterpart.

Source Codes Version

Those who has the source codes license can find the new asynchronous implementation in \SourcesAsync\ folder that is by default installed in C:\Program Files (x86)\IT Hit\WebDAV Server Engine\v4.x.x\ folder. The synchronous implementation is also provided in the source codes version and is located in \SourcesSync\ folder.