Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2133045 | 5.0u10 | Yujiang Wang | P4 | Closed | Won't Fix |
Here is a scenario which shows the problem:
File f = new File("\\\\machine\\officebean.dll");
URL url = f.toURL();
String s = url.toString();
URI u = new URI(s);
File f2 = new File(u);
During instantiation of f2 an IllegalArgumentException is thrown. The message is "URI has an authority component." The problem seems to be URL.toString which returns:
"file://machine/officebean.dll"
It would work if toString returned:
"file:////machine/officebean.dll"
File f = new File("\\\\machine\\officebean.dll");
URL url = f.toURL();
String s = url.toString();
URI u = new URI(s);
File f2 = new File(u);
During instantiation of f2 an IllegalArgumentException is thrown. The message is "URI has an authority component." The problem seems to be URL.toString which returns:
"file://machine/officebean.dll"
It would work if toString returned:
"file:////machine/officebean.dll"
- backported by
-
JDK-2133045 Deprecated toURL method does not handle UNC path
-
- Closed
-
- relates to
-
JDK-6351751 File.toURL() [deprecated] generates non conforming file url
-
- Closed
-
-
JDK-5086147 File,URI,URL conversions are strange for UNC path
-
- Resolved
-
-
JDK-6345387 java.net.URI: no difference between 'null' and empty authority
-
- Closed
-