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

zip-fs creates URIs that cannot be opened

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 9
    • core-libs
    • None

      zip-fs returns URIs that have been "double encoded", so that % sequences begin %25.

      To recreate, create a zip file with a space in the name, and one or more entries.
      Get a URI for a Path for one of the entries.
      Try and use URLConnection to get at the contents of the entry. You get FileNotFoundException.

      Attached is a program to demo the issue. Compile and run the program.
      Note it creates a file called "jar jar" i.e. with a space in the name.
      When you try and open a URI for an entry in the jar file, you get a message like:
      java.io.FileNotFoundException: /w/jjg/work/jfm2.0/dev.80130944/jar%20jar (No such file or directory)

      I could believe that the double encoding is correct, but in that case, URLConnection is wrong.
      One way or the other, the two are inconsistent. I should be able to open the URI returned for a Path in a file in a zip-fs filesystem.

        1. Bug.java
          2 kB
          Jonathan Gibbons

            sherman Xueming Shen
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: