cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject RE: [Bugs] URLSource
Date Fri, 17 May 2002 08:22:35 GMT
> Stefano Mazzocchi wrote:
> Carsten,
> I've recently switched to the new source-resolving excalibur code and I
> found that you use the following
>      File file = new File( this.systemId.substring( "file".length() ) );
Where did you see this? AFAIS it's ... "file:".length() ... for example
in the URLSource

> to obtain the 'path' part of a 'file' URI. The above might work on UNIX,
> but it clearly doesn't work on other operating systems, since URIs like
> these
>     file:///c:/path/to/file
> are totally valid and your code is not able to handle them.
> Now, my suggestion would be to use the standard API because
> they already handle all these issues (file: protocol handling is
> expecially tricky on regards of the number of slashes).
> NOTE: there is no official indication on how the file: URI should be
> addressed, but all these
>     file:/file
>     file://file
>     file:///file
> are all valid URIs and should point to the same file (at least, this was
> my understanding). It could be possible to add
>     file:file
> to indicate a relative location. This is normally achieved by avoiding
> to indicate the protocol (such as in "file"), but since we need a
> protocol to identify the handler, "file:file" might just be a way to
> encode relativity in file positioning.

Actually the code used in the "new" source resoling is the old code
which is in Cocoon 2 since the early days. So if this is a problem it
was there for "years".
Can someone verify if it is a problem on some OS and then please
do a patch?

>                                   - o -
> I just found another bug: the docs say that if you call
>    resolver.resolveURI()
> and the resource doesn't exist, you get a SourceNotFoundException. If yo
> are accessing file resources, instead you get a FileNotFoundException,
> which is not even inherited.
Yes, this is true and it's a bug! I added the SourceNotFoundException
but didn't have time to add the "throwing" code. So the docs are more
than the code...
Perhaps if someone could send a patch...

> Expect more bug report soon since I'm getting pretty heavy on sources :)
This is good! Really! I didn't have the time to do as much testing as I
as we are currently working on some great things for Cocoon which will
make Cocoon the number one web application framework and scare many big
as this all will be open source ;)
But currently I don't want to say more, I expect to finish most of it in


To unsubscribe, e-mail:
For additional commands, email:

View raw message