You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Nicolas Leclerc <nl...@novadeck.com> on 2002/09/02 14:47:39 UTC
excalibur.io.FileUtil.catPath () - replacement suggestion
i'not done messing with FileUtil :)
here's the problem:
catPath throws an ArrayIndexOutOfBoundsException if lookupPath
(the base path) does not contain any '/' char.
so, i've attached a replacement method.
the change in the new version are :
- no more ArrayIndexOutOfBoundsException, therefore support
of relative path is ok.
- output is normalized (wich makes the code significantly simplier,
but also often slower).
- always throws NullPointerException if any parameter is null.
Re: excalibur.io.FileUtil.catPath () - replacement suggestion
Posted by Nicolas Leclerc <nl...@novadeck.com>.
> applied. One thing I would love to see is some unit tests so that we don't
> regress to our old bugs...
ok, i'll try to get to it :)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: excalibur.io.FileUtil.catPath () - replacement suggestion
Posted by Peter Donald <pe...@apache.org>.
On Mon, 2 Sep 2002 22:47, Nicolas Leclerc wrote:
> i'not done messing with FileUtil :)
kool - Feel free to point out all the bugs you like ;)
> here's the problem:
> catPath throws an ArrayIndexOutOfBoundsException if lookupPath
> (the base path) does not contain any '/' char.
>
> so, i've attached a replacement method.
> the change in the new version are :
> - no more ArrayIndexOutOfBoundsException, therefore support
> of relative path is ok.
> - output is normalized (wich makes the code significantly simplier,
> but also often slower).
> - always throws NullPointerException if any parameter is null.
applied. One thing I would love to see is some unit tests so that we don't
regress to our old bugs...
--
Cheers,
Peter Donald
----------------------------------------
Whatever you do will be insignificant,
but it is very important that you do it.
--Gandhi
----------------------------------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>