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 <[EMAIL PROTECTED]>

Reply via email to