130 * 131 * The following properties may be specified when creating a Zip 132 * file system: 133 * <table class="striped"> 134 * <caption style="display:none"> 135 * Configurable properties that may be specified when creating 136 * a new Zip file system 137 * </caption> 138 * <thead> 139 * <tr> 140 * <th scope="col">Property Name</th> 141 * <th scope="col">Data Type</th> 142 * <th scope="col">Default Value</th> 143 * <th scope="col">Description</th> 144 * </tr> 145 * </thead> 146 * 147 * <tbody> 148 * <tr> 149 * <th scope="row">create</th> 150 * <td>java.lang.String</td> 151 * <td>false</td> 152 * <td> 153 * If the value is {@code true}, the Zip file system provider 154 * creates a new Zip or JAR file if it does not exist. 155 * </td> 156 * </tr> 157 * <tr> 158 * <th scope="row">encoding</th> 159 * <td>java.lang.String</td> 160 * <td>UTF-8</td> 161 * <td> 162 * The value indicates the encoding scheme for the 163 * names of the entries in the Zip or JAR file. 164 * </td> 165 * </tr> 166 * <tr> 167 * <td scope="row">enablePosixFileAttributes</td> 168 * <td>java.lang.String</td> 169 * <td>false</td> 170 * <td> 171 * If the value is {@code true}, the Zip file system will support 172 * the {@link java.nio.file.attribute.PosixFileAttributeView PosixFileAttributeView}. 173 * </td> 174 * </tr> 175 * <tr> 176 * <td scope="row">defaultOwner</td> 177 * <td>{@link java.nio.file.attribute.UserPrincipal UserPrincipal}<br> or java.lang.String</td> 178 * <td>null/unset</td> 179 * <td> 180 * Override the default owner for entries in the Zip file system.<br> 181 * The value can be a UserPrincipal or a String value that is used as the UserPrincipal's name. 182 * </td> 183 * </tr> 184 * <tr> 185 * <td scope="row">defaultGroup</td> 186 * <td>{@link java.nio.file.attribute.GroupPrincipal GroupPrincipal}<br> or java.lang.String</td> 187 * <td>null/unset</td> 188 * <td> 189 * Override the the default group for entries in the Zip file system.<br> 190 * The value can be a GroupPrincipal or a String value that is used as the GroupPrincipal's name. 191 * </td> 192 * </tr> 193 * <tr> 194 * <td scope="row">defaultPermissions</td> 195 * <td>{@link java.util.Set Set}<{@link java.nio.file.attribute.PosixFilePermission PosixFilePermission}><br> 196 * or java.lang.String</td> 197 * <td>null/unset</td> 198 * <td> 199 * Override the default Set of permissions for entries in the Zip file system.<br> 200 * The value can be a {@link java.util.Set Set}<{@link java.nio.file.attribute.PosixFilePermission PosixFilePermission}> or<br> 201 * a String that is parsed by {@link java.nio.file.attribute.PosixFilePermissions#fromString PosixFilePermissions::fromString} 202 * </td> 203 * </tr> 204 * </tbody> 205 * </table> 206 * 207 * <h2>Examples:</h2> 208 * 209 * Construct a new Zip file system that is identified by a URI. If the Zip file does not exist, 210 * it will be created: 211 * <pre> 212 * {@code 213 * 214 * URI uri = URI.create("jar:file:/home/luckydog/tennisTeam.zip"); 215 * Map<String, String> env = Map.of("create", "true"); 216 * FileSystem zipfs = FileSystems.newFileSystem(uri, env); 217 * } 218 * </pre> 219 * 220 * Construct a new Zip file system that is identified by specifying a path 221 * and using automatic file type detection. Iterate from the root of the JAR displaying each 222 * found entry: 223 * <pre> 224 * {@code 225 * 226 * FileSystem zipfs = FileSystems.newFileSystem(Path.of("helloworld.jar"), null); 227 * Path rootDir = zipfs.getPath("/"); 228 * Files.walk(rootDir) 229 * .forEach(System.out::println); 230 * } 231 * </pre> 232 * @provides java.nio.file.spi.FileSystemProvider 233 * @moduleGraph 234 * @since 9 235 */ 236 module jdk.zipfs { 237 provides java.nio.file.spi.FileSystemProvider with 238 jdk.nio.zipfs.ZipFileSystemProvider; 239 } | 130 * 131 * The following properties may be specified when creating a Zip 132 * file system: 133 * <table class="striped"> 134 * <caption style="display:none"> 135 * Configurable properties that may be specified when creating 136 * a new Zip file system 137 * </caption> 138 * <thead> 139 * <tr> 140 * <th scope="col">Property Name</th> 141 * <th scope="col">Data Type</th> 142 * <th scope="col">Default Value</th> 143 * <th scope="col">Description</th> 144 * </tr> 145 * </thead> 146 * 147 * <tbody> 148 * <tr> 149 * <th scope="row">create</th> 150 * <td>{@link java.lang.String} or {@link java.lang.Boolean}</td> 151 * <td>false</td> 152 * <td> 153 * If the value is {@code true}, the Zip file system provider 154 * creates a new Zip or JAR file if it does not exist. 155 * </td> 156 * </tr> 157 * <tr> 158 * <th scope="row">encoding</th> 159 * <td>{@link java.lang.String}</td> 160 * <td>UTF-8</td> 161 * <td> 162 * The value indicates the encoding scheme for the 163 * names of the entries in the Zip or JAR file. 164 * </td> 165 * </tr> 166 * <tr> 167 * <th scope="row">enablePosixFileAttributes</th> 168 * <td>{@link java.lang.String} or {@link java.lang.Boolean}</td> 169 * <td>false</td> 170 * <td> 171 * If the value is {@code true}, the Zip file system will support 172 * the {@link java.nio.file.attribute.PosixFileAttributeView PosixFileAttributeView}. 173 * </td> 174 * </tr> 175 * <tr> 176 * <th scope="row">defaultOwner</th> 177 * <td>{@link java.nio.file.attribute.UserPrincipal UserPrincipal}<br> or 178 * {@link java.lang.String}</td> 179 * <td>null/unset</td> 180 * <td> 181 * Override the default owner for entries in the Zip file system.<br> 182 * The value can be a UserPrincipal or a String value that is used as the UserPrincipal's name. 183 * </td> 184 * </tr> 185 * <tr> 186 * <th scope="row">defaultGroup</th> 187 * <td>{@link java.nio.file.attribute.GroupPrincipal GroupPrincipal}<br> or 188 * {@link java.lang.String}</td> 189 * <td>null/unset</td> 190 * <td> 191 * Override the the default group for entries in the Zip file system.<br> 192 * The value can be a GroupPrincipal or a String value that is used as the GroupPrincipal's name. 193 * </td> 194 * </tr> 195 * <tr> 196 * <th scope="row">defaultPermissions</th> 197 * <td>{@link java.util.Set Set}<{@link java.nio.file.attribute.PosixFilePermission PosixFilePermission}><br> 198 * or {@link java.lang.String}</td> 199 * <td>null/unset</td> 200 * <td> 201 * Override the default Set of permissions for entries in the Zip file system.<br> 202 * The value can be a {@link java.util.Set Set}<{@link java.nio.file.attribute.PosixFilePermission PosixFilePermission}> or<br> 203 * a String that is parsed by {@link java.nio.file.attribute.PosixFilePermissions#fromString PosixFilePermissions::fromString} 204 * </td> 205 * </tr> 206 * <tr> 207 * <th scope="row">compressionMethod</th> 208 * <td>{@link java.lang.String}</td> 209 * <td>DEFLATED</td> 210 * <td> 211 * The value representing the compression method to use when adding entries 212 * to the Zip file system. 213 * <ul> 214 * <li> 215 * If the value is {@code STORED}, the Zip file system provider will 216 * not compress entries when writing to the Zip file system. 217 * </li> 218 * <li> 219 * If the value is {@code DEFLATED} or the property is not set, 220 * the Zip file system provider will use data compression when 221 * writing entries to the Zip file system. 222 * </li> 223 * <li> 224 * If the value is not {@code STORED} or {@code DEFLATED}, an 225 * {@code IllegalArgumentException} will be thrown. 226 * </li> 227 * </ul> 228 * </td> 229 * </tr> 230 * <tr> 231 * <th scope="row">releaseVersion</th> 232 * <td>{@link java.lang.String} or {@link java.lang.Integer} or 233 * {@link java.lang.Runtime.Version}</td> 234 * <td>null/unset</td> 235 * <td> 236 * A value representing the version entry to use when accessing a 237 * multi-release JAR. If the JAR is not a multi-release JAR, the value 238 * will be ignored and the JAR will considered un-versioned. 239 * 240 * <p> 241 * 242 * <ul> 243 * <li> 244 * If the value is {@code null} or the property is not set, 245 * then the JAR will be treated as an un-versioned JAR. 246 * </li> 247 * <li> 248 * If the value is {@code "runtime"} or is a 249 * {@linkplain java.lang.Runtime.Version Version} Object, the 250 * version entry will be determined by invoking 251 * {@linkplain Runtime.Version#feature() Version.feature()}. 252 * </li> 253 * <li> 254 * If the Object is a {@linkplain java.lang.String} or an 255 * {@linkplain java.lang.Integer}, its value must represent a valid 256 * {@linkplain Runtime.Version Java SE Platform version number}, 257 * such as {@code 9}, {@code 11.0.1}, or {@code 14} in order to 258 * determine the version entry. 259 * </li> 260 * <li> 261 * If the value does not represent a valid 262 * {@linkplain Runtime.Version Java SE Platform version number}, 263 * an {@code IllegalArgumentException} will be thrown. 264 * </li> 265 * </ul> 266 * </td> 267 * </tr> 268 * </tbody> 269 * </table> 270 * 271 * <h2>Examples:</h2> 272 * 273 * Construct a new Zip file system that is identified by a URI. If the Zip file does not exist, 274 * it will be created: 275 * <pre> 276 * {@code 277 * 278 * URI uri = URI.create("jar:file:/home/luckydog/tennisTeam.zip"); 279 * Map<String, String> env = Map.of("create", "true"); 280 * FileSystem zipfs = FileSystems.newFileSystem(uri, env); 281 * } 282 * </pre> 283 * 284 * Construct a new Zip file system that is identified by specifying a path 285 * and using automatic file type detection. Iterate from the root of the JAR displaying each 286 * found entry: 287 * <pre> 288 * {@code 289 * 290 * FileSystem zipfs = FileSystems.newFileSystem(Path.of("helloworld.jar")); 291 * Path rootDir = zipfs.getPath("/"); 292 * Files.walk(rootDir) 293 * .forEach(System.out::println); 294 * } 295 * </pre> 296 * @provides java.nio.file.spi.FileSystemProvider 297 * @moduleGraph 298 * @since 9 299 */ 300 module jdk.zipfs { 301 provides java.nio.file.spi.FileSystemProvider with 302 jdk.nio.zipfs.ZipFileSystemProvider; 303 } |