-
Sub-task
-
Resolution: Delivered
-
P4
-
25
The ZIP file system provider is updated to allow a ZIP file system be created as a read-only or read-write file system. When creating a ZIP file system, the property name "`accessMode`" can be used with a value of "`readOnly`" or " `readWrite`" to specify the desired mode. If the property is not provided then the file system is created as a read-write file system if possible.
The following example creates a read-only file system:
```
FileSystem zipfs = FileSystems.newFileSystem(pathToZipFile, Map.of("accessMode","readOnly"));
```
See the `jdk.zipfs` module description for more information on this and other properties supported by the ZIP file system provider.
The following example creates a read-only file system:
```
FileSystem zipfs = FileSystems.newFileSystem(pathToZipFile, Map.of("accessMode","readOnly"));
```
See the `jdk.zipfs` module description for more information on this and other properties supported by the ZIP file system provider.