Re: ChromeJarResourceLoader and winXP jdk142 and webstart

Gerald Bauer <[email protected]> Thu, 2 Oct 2003 11:02:36 -0700 (PDT)
Newsgroups gmane.comp.java.luxor-xul.user
Message-ID <[email protected]>
Hi Denis,

> thanks a lot for the hint. Fortunatly I have not yet
> come across all the problems you are mentioning
> below
> :-) I have been able to cope with my problem by
> adding
> the following line (with the %20): 
> 
>   String jarFileName =ClassUtils.getJarFileName(
> anchor );
> + jarFileName = jarFileName.replaceAll("%20"," ");  
>   File file = new File( jarFileName );
>   JarFile jarFile = new JarFile( file, false ); 

  Glad you found it. You're more than welcome to check
in your quick fix.

> It looks like the problem arise from the spaces in
> the
> "c:\program files" directory... Looks like a M$
> conspiracy... In fact it looks like there is no good
> URL-->File conversion method in java. The space
> character has been escaped to %20 when calling the
> URL.getExternalForm(), but there could be many more
> characters that could undergo that transformation...
> Seems scary! 

   I suggest using java.net.URLEncoder.decode() or a
similar method to handle all possible escaped chars to
turn an URL back to a plain-vanilla ASCII string.

> Perhaps it could be better to go
> directly
> from URL --> JarEntry without going through the
> java.io.File concept. What do you think about it?

  I'm not sure how this works. But if you cut out one
level of indirection it makes sense to try it.

  - Gerald


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf