cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Stochmialek <mi...@e-informatyka.pl>
Subject WebDAVSource.getParent() and makeCollection()
Date Sun, 27 Jun 2004 22:01:23 GMT
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 <misto@e-informatyka.pl>

Mime
View raw message