Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6360233

Deprecated toURL method does not handle UNC path

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 6
    • 5.0u6
    • core-libs
    • None
    • x86
    • windows

        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"

              iris Iris Clark
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: