Parsing of URL's which contain Windows Path separator (original) (raw)
Shirish Kuncolienkar shirishk at linux.vnet.ibm.com
Thu Aug 9 01:53:20 PDT 2012
- Previous message: hg: jdk8/tl/jdk: 7189944: (launcher) test/tools/launcher/Arrrrghs.java needs a couple of minor fixes
- Next message: Parsing of URL's which contain Windows Path separator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I have the following piece of code
URL url = new URL("file", "/", "C:\\temp\\Java6");
System.out.println(url);
URL url1 = new URL(url, "hello.html");
System.out.println(url1);
first System out prints as "file:///C:\temp\Java6\Lotus" Second one prints the value "file:////hello.html"
As mentioned by URL parser specification the windows path separator happens to be a special character and hence the whole path is considered as a single block. However it will be useful for the URL class to take consider "" character as a path separator as a special case and be able create relative url which is a valid one.
I see mozilla browser simply replaces the "" by a "/" and continues. URL parser could follow a similar approach.
Any thoughts ?
- Previous message: hg: jdk8/tl/jdk: 7189944: (launcher) test/tools/launcher/Arrrrghs.java needs a couple of minor fixes
- Next message: Parsing of URL's which contain Windows Path separator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]