URLStreamHandler.parseURL() (was RE: Patch: more protocol fun in URL)
Jeroen Frijters
jeroen@sumatra.nl
Mon Jul 5 15:25:00 GMT 2004
Mohan Embar wrote:
> You have removed this block:
>
> -if (lastSlash < 0 && File.separatorChar != sepChar
> - && url.getProtocol().equals("file"))
> - {
> - // On Windows, even '\' is allowed in a "file" URL.
> - sepChar = File.separatorChar;
> - lastSlash = file.lastIndexOf(sepChar);
> - }
>
> ...and have replaced it with this:
>
> +int lastSlash = file.lastIndexOf('/');
>
> ...but nowhere in your patch have you changed the
> original contents of the file variable, which contains
> this backslash.
Thanks, I see what you mean now. I still disagree with it though ;-)
AFAIK, on Windows a '\' is not valid in a url, so URL.getFile() should
always return a '/' separated path. If it doesn't do that, then this
should be fixed, but I don't think the problem is here.
Regards,
Jeroen
More information about the Java-patches
mailing list