Uploaded image for project: 'JBoss VFS'
  1. JBoss VFS
  2. JBVFS-160

FileSystemContext.getFileURI returns wrong URI for UNC paths on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.1.4.GA, 2.2.0.SP1
    • 2.1.3.SP1, 2.2.0.Alpha2
    • None
    • None
    • Hide

      This bug can be avoided if the UNC path is mapped to a drive letter, and accessed via that instead.

      Show
      This bug can be avoided if the UNC path is mapped to a drive letter, and accessed via that instead.

      When passed a File for something with a UNC path (e.g. \\127.0.0.1\shared), FileSystemContext.getFileURI() return a URI like "file://127.0.0.1/shared" (which is what Windows itself uses) rather than "file:////127.0.0.1/shared" (which Java uses, and converts for OS calls). This will cause JBoss to fail to deploy things if they are located on an unmapped UNC location.

      I'm attaching a test case for this. To use it, you need to run it on a Windows system and have access to a something with a UNC path. The code as written expects there to be a SMB share called "shared" on the machine it is run on, but it can easily be change to point elsewhere.

        1. UncPathTest.java
          0.6 kB
        2. vfs-unc.diff
          0.5 kB
        3. vfs-uri-unc.diff
          0.7 kB

            ajustin@redhat.com Ales Justin
            rhn-support-jlivings James Livingston (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: