Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-35

[VFS] URI of LocalFile contains second slash after scheme

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Bugzilla Id:
      35848

      Description

      Hello,

      the code

      FileSystemManager fsManager = VFS.getManager();
      FileObject file = fsManager.resolveFile("D:/test.txt");
      System.out.println("VFS: " + file.getName().getURI());

      File ioFile = new File("D:/test.txt");
      System.out.println("IO: " + ioFile.toURI());

      prints

      VFS: file://D:/test.txt
      IO: file:/D:/test.txt

      Note the second slash in first URI.

      If you replace

      buffer.append("://")

      in LocalFileName.appendRootUri(StringBuffer) with

      buffer.append(":/");

      the URI is correct. But I have no idea about some side effects.

      Please check that.

        Attachments

        1. ASF.LICENSE.NOT.GRANTED--35848.txt
          0.6 kB
          Martin Burger

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              m@rtin-burger.de Martin Burger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: