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

Read-only Zip file systems should be supported

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • core-libs
    • None
    • minimal
    • Adding a new environmental parameter to a file-system should not cause any risk of issues for existing users (default behaviour remains the same).
    • Java API

      Summary

      Add support for explicit creation of ZipFileSystem instances via the "environment" parameters.

      Problem

      Zip/Jar files are often expected to be used as archives, and as such it may be surprising if contents are modified as a side effect of other actions. To facilitate a robust mechanism for avoiding accidental "write back" to Zip/Jar files by applications, there should be a mechanism for mounting them in a read-only state.

      Solution

      Add a new "readOnly" environmental parameter to allow anyone explicitly creating zip file system instance to specify that they want it to be read-only.

      Specification

      src/jdk.zipfs/share/classes/module-info.java

       * <tr>
       *   <th scope="row">readOnly</th>
       *   <td>{@link java.lang.String} or {@link java.lang.Boolean}</td>
       *   <td>false</td>
       *   <td>
       *       If the value is {@code true}, the ZIP file system will be read-only.
       *   </td>
       * </tr>

            dabeaumo David Beaumont
            dabeaumo David Beaumont
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: