< prev index next >

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

Print this page




 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}&lt;{@link java.nio.file.attribute.PosixFilePermission PosixFilePermission}&gt;<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}&lt;{@link java.nio.file.attribute.PosixFilePermission PosixFilePermission}&gt; 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}&lt;{@link java.nio.file.attribute.PosixFilePermission PosixFilePermission}&gt;<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}&lt;{@link java.nio.file.attribute.PosixFilePermission PosixFilePermission}&gt; 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 writing 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 when the Zip
 226  *               filesystem is created.
 227  *           </li>
 228  *       </ul>
 229  *   </td>
 230  * </tr>
 231  * <tr>
 232  *   <th scope="row">releaseVersion</th>
 233  *   <td>{@link java.lang.String} or {@link java.lang.Integer}</td>
 234  *   <td>null/unset</td>
 235  *   <td>
 236  *       A value representing the version entry to use when accessing a
 237  *       <a href=="{@docRoot}/../specs/jar/jar.html#multi-release-jar-files">
 238  *       multi-release JAR</a>. If the JAR is not a
 239  *       <a href=="{@docRoot}/../specs/jar/jar.html#multi-release-jar-files">
 240  *       multi-release JAR</a>, the value will be ignored and the JAR will
 241  *       considered un-versioned.
 242  *       <p>
 243  *       The value must represent a valid
 244  *       {@linkplain Runtime.Version Java SE Platform version number},
 245  *       such as {@code 9}, or {@code 14} in order to determine the version entry.
 246  *
 247  *       <ul>
 248  *           <li>
 249  *               If the value is {@code null} or the property is not set,
 250  *               then the JAR will be treated as an un-versioned JAR.
 251  *           </li>
 252  *           <li>
 253  *               If the value is {@code "runtime"}, the
 254  *               version entry will be determined by invoking
 255  *               {@linkplain Runtime.Version#feature() Runtime.Version.feature()}.
 256  *           </li>
 257  *           <li>
 258  *               If the value does not represent a valid
 259  *               {@linkplain Runtime.Version Java SE Platform version number},
 260  *               an {@code IllegalArgumentException} will be thrown.
 261  *           </li>
 262  *       </ul>
 263  *   </td>
 264  * </tr>
 265  *  </tbody>
 266  * </table>
 267  *
 268  * <h2>Examples:</h2>
 269  *
 270  * Construct a new Zip file system that is identified by a URI.  If the Zip file does not exist,
 271  * it will be created:
 272  * <pre>
 273  * {@code
 274  *
 275  *     URI uri = URI.create("jar:file:/home/luckydog/tennisTeam.zip");
 276  *     Map<String, String> env = Map.of("create", "true");
 277  *     FileSystem zipfs = FileSystems.newFileSystem(uri, env);
 278  * }
 279  * </pre>
 280  *
 281  * Construct a new Zip file system that is identified by specifying a path
 282  * and using automatic file type detection. Iterate from the root of the JAR displaying each
 283  * found entry:
 284  * <pre>
 285  * {@code
 286  *
 287  *     FileSystem zipfs = FileSystems.newFileSystem(Path.of("helloworld.jar"));
 288  *     Path rootDir = zipfs.getPath("/");
 289  *     Files.walk(rootDir)
 290  *            .forEach(System.out::println);
 291  * }
 292  * </pre>
 293  * @provides java.nio.file.spi.FileSystemProvider
 294  * @moduleGraph
 295  * @since 9
 296  */
 297 module jdk.zipfs {
 298     provides java.nio.file.spi.FileSystemProvider with
 299         jdk.nio.zipfs.ZipFileSystemProvider;
 300 }
< prev index next >