Deprecated toURL method does not handle UNC path

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P4
    • 6
    • Affects Version/s: 5.0u6
    • Component/s: 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"

              Assignee:
              Iris Clark
              Reporter:
              J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: