[jcifs] Re: [Davenport-general] WebDAV Level 2 support

Julian Reschke julian.reschke at gmx.de
Thu Feb 12 21:28:46 GMT 2004


Michael B Allen wrote:

> I would think because HTTP is stateless, it would be rather difficult to
> implement what is effectively a stateful feature. What happends if you
> lock a file and never return because your browser closed? Is there a way

Either the lock times out, or it stays there infinitely. Depends on (1) 
how the lock is created and (2) what the defaults/constraints are on the 
server (for instance, a server may limit the max. expiration time). Note 
that clients can discover lock tokens using PROPFIND, so even if a lock 
is "lost" (application crash?), another client can unlock the resource 
after discovering the lock token (so this is a *cooperative* feature).

> for a servelet container to detect when a user has closed their session so
> it can close the session to the CIFS server thereby unlocking any files?

Nope, and this is not what you want for a WebDAV lock. So yes, if you 
can't directly map WebDAV locking semantics to CIFS semantics, there may 
be a need for a mapping layer, local persistence and timeout handling.

I'd definitely try a simple mapping first, possibly limiting the maximal 
lock timeout to a sane value (Microsoft Office assumes that I'll get a 
180-second lock, and then will start refreshing it).

Julian

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760


More information about the jcifs mailing list