Implement LockingCollectionResource

OK, this is the tricky one, despite its simple looking interface

When createAndLock is called you somehow need to record a placeholder resource which is neither a file nor a collection, but which will become a file or collection when the next PUT or MKCOL is called on the same resource.

Note that you shouldnt ignore this, because it implements a vitally important mechanism for operating system clients. It provides an atomic action which:

  • checks for the existence of a resource with the given path
  • creates it (sort of)
  • locks it

Its necessary that these steps can all be done atomically to ensure files dont get overwritten by different processes. In reality this will happen rarely, but because some operating systems are predicated on this capability being available, you really need it.