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

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      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
    • Interface Kind:
      Java API
    • Scope:
      JDK

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: