You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Brad <ja...@javawork.co.uk> on 2008/01/31 15:12:24 UTC

WebDAV PUT failing when parent directory locked

Hi all,

to avoid concurrent modification problems, I'm trying to use an
exclusive lock on a directory in the WebDAV repository. I can lock and
unlock the directory with no problems, but as soon as I try to PUT a
file in the locked directory, I get a 423 Locked response.

Here's the header from the Lock Method:

LOCK /jcr-webdav/repository/default/audit/staging/files HTTP/1.1
Content-Type: text/xml; charset=utf-8
User-Agent: Jakarta Commons-HttpClient/2.0final
Host: loire:8080
Content-Length: 238
Authorization: Basic FKOtaEWDFWEFRtaW4=
Depth: infinity
Timeout: Infinite, Second-2147483647

Response: HTTP/1.1 200 OK

Here's the PUT header:

PUT /jcr-webdav/repository/default/files/n1201787394075 HTTP/1.1
If: <b257cb01-0a63-4841-abe6-744b95f41ae2-F>
User-Agent: Jakarta Commons-HttpClient/2.0final
Host: loire:8080
Content-Length: 1480
Authorization: Basic FKOtaEWDFWEFRtaW4=

Response: HTTP/1.1 423 Locked

Finally, the header from the Unlock:

UNLOCK /jcr-webdav/repository/default/audit/staging/files HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/2.0final
Host: loire:8080
Authorization: Basic FKOtaEWDFWEFRtaW4=
Lock-Token: <b257cb01-0a63-4841-abe6-744b95f41ae2-F>

Response: HTTP/1.1 204 No Content

Those are in the sequence they were sent. What I don't understand is
why the unlock method is happy with the lock token but the PUT method
fails. Any ideas where I'm going wrong?

Thanks,
Brad.

Re: WebDAV PUT failing when parent directory locked

Posted by Brad <br...@javawork.co.uk>.
Julian,

that's fixed it, thanks for your help.

On Jan 31, 2008 2:18 PM, Julian Reschke <ju...@gmx.de> wrote:
> Brad wrote:
> > ...
> > Here's the PUT header:
> >
> > PUT /jcr-webdav/repository/default/files/n1201787394075 HTTP/1.1
> > If: <b257cb01-0a63-4841-abe6-744b95f41ae2-F>
> > ...
>
> IMHO, this needs to be
>
>    If: (<b257cb01-0a63-4841-abe6-744b95f41ae2-F>)
>
> See: <http://greenbytes.de/tech/webdav/rfc4918.html#if.header.syntax>.
>
> BR, Julian
>

Re: WebDAV PUT failing when parent directory locked

Posted by Julian Reschke <ju...@gmx.de>.
Brad wrote:
> ...
> Here's the PUT header:
> 
> PUT /jcr-webdav/repository/default/files/n1201787394075 HTTP/1.1
> If: <b257cb01-0a63-4841-abe6-744b95f41ae2-F>
> ...

IMHO, this needs to be

   If: (<b257cb01-0a63-4841-abe6-744b95f41ae2-F>)

See: <http://greenbytes.de/tech/webdav/rfc4918.html#if.header.syntax>.

BR, Julian