Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2133262 | 5.0u8 | Yujiang Wang | P4 | Closed | Won't Fix |
See:
Exception in thread "main" java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(File.java:340)
caused by code:
File f = new File ("//SERVER/MyDocuments/USER/DIR/");
new File (f.toURI().toURL().toURI()); /* file://SERVER/MyDocuments/USER/DIR */
but following code is OK:
new File (f.toURI()); /* file:////SERVER/MyDocuments/USER/DIR */
Its fragile, not mentioning that URI.normalize () complicates it even more (file:/SERVER/MyDocuments/USER/DIR)
Exception in thread "main" java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(File.java:340)
caused by code:
File f = new File ("//SERVER/MyDocuments/USER/DIR/");
new File (f.toURI().toURL().toURI()); /* file://SERVER/MyDocuments/USER/DIR */
but following code is OK:
new File (f.toURI()); /* file:////SERVER/MyDocuments/USER/DIR */
Its fragile, not mentioning that URI.normalize () complicates it even more (file:/SERVER/MyDocuments/USER/DIR)
- backported by
-
JDK-2133262 File,URI,URL conversions are strange for UNC path
-
- Closed
-
- relates to
-
JDK-6360233 Deprecated toURL method does not handle UNC path
-
- Closed
-
-
JDK-4723726 URI.normalize() ruins URI built from UNC File
-
- Closed
-
-
JDK-4241259 java.io.File.getParentFile() returns non directory
-
- Closed
-