WebDAV support

Introduction

WebDAV is a popular protocol that facilitates the remote edition of Web resources. It is an extension of the HTTP protocol which defines new methods and headers.

Mini WebDAV mode

Built in the core of Restlet, there is a org.restlet.Directory class lets you (deeply) expose a directory of static files and serve them like a standard Web server. In addition, if you set the "modifiable" property to true, the Directory also supports the creation or update of files via the PUT method and the removal via the DELETE one. The current approach is useful but doesn't fully support the DAV1 profile ; hence the "mini WebDAV mode" name.

GoGoEgo project

If you are looking for a more complete WebDAV support, you should look at the GoGoEgo open source project. It is a modern JVM-based platform for creating and managing Web sites, optimized for the needs of small business and e-commerce.

This project builds on top of the Restle framework and provides a DAV 1 implementation with DAV 2 stubs. The source code is available from their SVN repository ; see especially this package. Here is a more detailled description of the current implementation given by Rob Heittman:

"In VFSResource, Dav1VFSResource, Dav2VFSResource, we are exposing the versioned file system of our CMS, using Restlet resources, in a way that is compatible with MS Web Folders as well as South River Webdrive and wdfs.  I use this implementation all day, every day with wdfs to do mission critical work; it's well exercised.
You can see in Dav2VFSResource where the lock and unlock support would be if the underlying storage supported locking semantics ... the fact that it's not implemented here isn't Restlet's fault, but GoGoEgo's open source VFS layer doesn't yet support locking.  Dav2VFSResource "fakes" it to keep certain clients happy, notably OS X.
You could do this all in a more Restlety way -- especially if you are just working with plain old files and don't need to access a special repository -- but most of what you see here is a port of a port of a port.  It does contain all the necessary hints for what MS Web Folders expects to see in its headers, etc. and some ideas of how to glue this to Restlet.  The public GoGoEgo repository is licensed under GPL, but if you want us to grant an individual license that is compatible with your own for any portions of this code, just email me personally and we can make arrangements.
A final note, see in the comments of Dav1VFSResource that it intentionally violates RFC2518 in two ways that I would recommend preserving -- but if you want an RFC compliant version you must take these violations out."

Comments (0)