Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 36978 invoked from network); 29 Mar 2004 10:52:48 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 29 Mar 2004 10:52:48 -0000 Received: (qmail 32479 invoked by uid 500); 29 Mar 2004 10:52:21 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 32328 invoked by uid 500); 29 Mar 2004 10:52:20 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 32317 invoked by uid 500); 29 Mar 2004 10:52:20 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 32312 invoked from network); 29 Mar 2004 10:52:20 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 29 Mar 2004 10:52:20 -0000 Received: (qmail 36896 invoked by uid 1758); 29 Mar 2004 10:52:46 -0000 Date: 29 Mar 2004 10:52:46 -0000 Message-ID: <20040329105246.36894.qmail@minotaur.apache.org> From: unico@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/blocks/webdav/java/org/apache/cocoon/components/source/impl WebDAVSource.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N unico 2004/03/29 02:52:46 Modified: src/blocks/webdav/java/org/apache/cocoon/components/source/impl WebDAVSource.java Log: check if MKCOL actually succeeded Revision Changes Path 1.26 +22 -7 cocoon-2.1/src/blocks/webdav/java/org/apache/cocoon/components/source/impl/WebDAVSource.java Index: WebDAVSource.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/webdav/java/org/apache/cocoon/components/source/impl/WebDAVSource.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- WebDAVSource.java 27 Mar 2004 17:40:11 -0000 1.25 +++ WebDAVSource.java 29 Mar 2004 10:52:46 -0000 1.26 @@ -547,7 +547,7 @@ return WebDAVSource.newWebDAVSource(childURL, this.protocol, getLogger()); } catch (URIException e) { - throw new SourceException("Failure creating child", e); + throw new SourceException("Failed to create child", e); } } @@ -627,7 +627,7 @@ return WebDAVSource.newWebDAVSource(parentURL, this.protocol, getLogger()); } catch (URIException e) { - throw new SourceException("Failure creating parent", e); + throw new SourceException("Failed to create parent", e); } } @@ -745,7 +745,7 @@ private void cancel() { if (isClosed) { - throw new IllegalStateException("Cannot cancel: outputstrem is already closed"); + throw new IllegalStateException("Cannot cancel: outputstream is already closed"); } this.isClosed = true; } @@ -761,10 +761,25 @@ initResource(WebdavResource.NOACTION, DepthSupport.DEPTH_0); if (this.resource.exists()) return; try { - this.resource.mkcolMethod(); - } catch (HttpException e) { + if (!this.resource.mkcolMethod()) { + int status = this.resource.getStatusCode(); + // Ignore status 405 - Not allowed: collection already exists + if (status != 405) { + final String msg = + "Unable to create collection " + getSecureURI() + + ". Server responded " + this.resource.getStatusCode() + + " (" + this.resource.getStatusMessage() + ")"; + throw new SourceException(msg); + } + } + } + catch (HttpException e) { throw new SourceException("Unable to create collection(s) " + getSecureURI(), e); - } catch (IOException e) { + } + catch (SourceException e) { + throw e; + } + catch (IOException e) { throw new SourceException("Unable to create collection(s)" + getSecureURI(), e); } }