Bugs item #676243, was opened at 2003-01-28 18:23
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=676243&group_id=22866

Category: JBossServer
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew Everitt (andieveritt)
Assigned to: Nobody/Anonymous (nobody)
Summary: FileURLConnection needs URL decode for JDK 1.4

Initial Comment:
In the constructor of
org.jboss.net.protocol.file.FileURLConnection a new
File is created from the supplied URL. In JDK 1.4 the
result of URL.getPath() is URL encoded which means on
windows with a path with a space you get
'C:\Program%20Files\foo\bar' - which doesn't work.
I have tested a modified version of FileURLConnection
which URL decodes the result. This resolves the issue.
I have attached the modified version. The only change
is on Line 45:
-       file = new File(url.getPath().replace('/',
File.separatorChar).replace('|', ':'));
+      file = new
File(java.net.URLDecoder.decode(url.getPath()).replace('/',
File.separatorChar).replace('|', ':'));


----------------------------------------------------------------------

>Comment By: Andrew Everitt (andieveritt)
Date: 2003-02-20 14:55

Message:
Logged In: YES 
user_id=689882

OK, after some investigation it appears that this may not be
quite the correct fix! The problem is some apparent
inconsistency with when paths are getting URL encoded.
Somethings like:
URL url = new URL("file:///C:/Program Files/foo/bar");
Doesn't seem to get URL encoded and will work fine when
passed to FileURLConnection. However things like:
URL csurl =
Some.class.getProtectionDomain().getCodeSource().getLocation();
and
URL res = Some.class.getClassLoader().getResource("File in
path with space.txt");
returns a path that is URL encoded and so doesn't work when
a file is in a path with a space.

I guess that JBoss is using these calls to get URLs for
resources which then throw up later.

More to follow.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=676243&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to