Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 11236 invoked from network); 27 Jun 2004 22:03:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Jun 2004 22:03:25 -0000 Received: (qmail 41351 invoked by uid 500); 27 Jun 2004 22:03:23 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 41293 invoked by uid 500); 27 Jun 2004 22:03:22 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 41263 invoked by uid 99); 27 Jun 2004 22:03:22 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received: from [156.17.10.13] (HELO sysop.ci.pwr.wroc.pl) (156.17.10.13) by apache.org (qpsmtpd/0.27.1) with ESMTP; Sun, 27 Jun 2004 15:03:20 -0700 Received: from sysop.ci.pwr.wroc.pl (localhost [127.0.0.1]) by sysop.ci.pwr.wroc.pl (8.12.8/8.12.8) with ESMTP id i5RM353G006585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 28 Jun 2004 00:03:06 +0200 Received: (from misto@localhost) by sysop.ci.pwr.wroc.pl (8.12.8/8.12.8/Submit) id i5RM35ne006582 for dev@cocoon.apache.org; Mon, 28 Jun 2004 00:03:05 +0200 Date: Mon, 28 Jun 2004 00:01:23 +0200 From: Michal Stochmialek To: dev@cocoon.apache.org Subject: WebDAVSource.getParent() and makeCollection() Message-ID: <20040627220123.GA19394@frodo.freak> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, Something's wrong with implementation of getParent and makeCollection methods. (in cocoon 2.1.5) makeCollection() - creates collection only if parent exists. Can't create directory hierarchy. When I try, i've got this exception: org.apache.excalibur.source.SourceException: Unable to create collection webdav://localhost/svn/einformatyka/articles/review/1088372068812. Server responded 404 (Not Found (404)) Directory einformatyka/articles exists, review - don't. Is this correct implementation of ModifiableTraversableSource? Well, i tried to make a work around, and created method like this: private void createDirectories(ModifiableTraversableSource source) throws SourceException { System.out.println("Creating dir ["+source.getURI()+"] " + " EXISTS: "+source.exists()); if (source.exists()) return; if (!source.getParent().exists()) createDirectories((ModifiableTraversableSource)source.getParent()); source.makeCollection(); } And this doesn't work too. It goes into infintive loop of recursive calls. On standard output I get: Creating dir [webdav://localhost/svn/einformatyka/articles/review/1088373196783] EXISTS: false Creating dir [webdav://localhost/svn/einformatyka/articles/review/] EXISTS: false Creating dir [webdav://localhost/svn/einformatyka/articles/review/] EXISTS: false Creating dir [webdav://localhost/svn/einformatyka/articles/review/] EXISTS: false Creating dir [webdav://localhost/svn/einformatyka/articles/review/] EXISTS: false [ and so on...] NOTE slash at the end of URI (review/) This example demonstrates that sometimes: source == source.getParent()... Is this a bug in cocoon or in webdav-lib? Or is this a feature? ;) regrads, -- Michal Stochmialek