cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject [Bugs] URLSource
Date Wed, 15 May 2002 17:37:37 GMT

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() ) );

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


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


are all valid URIs and should point to the same file (at least, this was
my understanding). It could be possible to add


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.

                                  - o -

I just found another bug: the docs say that if you call


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.

Expect more bug report soon since I'm getting pretty heavy on sources :)

Stefano Mazzocchi      One must still have chaos in oneself to be
                             able to give birth to a dancing star.
<>                             Friedrich Nietzsche

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

View raw message