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

(zipfs) FileSystemProvider.newFileSystem(Path, Map) should throw IOException when called with a file that cannot be open

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 14
    • core-libs
    • None
    • behavioral
    • low
    • Hide
      The change will align the Zip FS behavior with the expected IOException thrown when the file does not exist and is not being created.

      Given support for Zip FS is new as of JDK 9, we do not believe there is a huge compatibility risk
      Show
      The change will align the Zip FS behavior with the expected IOException thrown when the file does not exist and is not being created. Given support for Zip FS is new as of JDK 9, we do not believe there is a huge compatibility risk
    • Java API
    • JDK

      Summary

      Invoking java.nio.file.FileSystems.newFileSystem(Path) to create a Zip file system throws FileSystemNotFoundException instead of IOException when the Zip or JAR file does exist (the create option is not specified).

      Problem

      Since the original Zip FS prototype in JDK 7, the Zip FS incorrectly throws FileSystemNotFoundException when the specified Zip or JAR does not exist and is not being created.

      Solution

      Zip FS will throw a NoSuchFileException, which is a subclass of IOException, if the file does not exist and is not being created.

      Specification

      There is no change required to the specification.

            lancea Lance Andersen
            dbessono Dmitry Bessonov
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: