< prev index next >

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

Print this page




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /**
  27  * Provides the implementation of the Zip file system provider.
  28  * The Zip file system provider treats the contents of a Zip or JAR file as a file system.
  29  * <p>
  30  *
  31  * <h3>Accessing a Zip File System</h3>
  32  *
  33  * The {@linkplain java.nio.file.FileSystems FileSystems} {@code newFileSystem}
  34  * static factory methods can be used to:
  35  * <ul>
  36  *     <li>Create a Zip file system</li>
  37  *     <li>Open an existing file as a Zip file system</li>
  38  * </ul>
  39  *
  40  * <h3>URI Scheme Used to Identify the Zip File System</h3>
  41  *
  42  * The URI {@link java.net.URI#getScheme scheme} that identifies the ZIP file system is {@code jar}.
  43  *
  44  * <h3>Zip File System Properties</h3>
  45  *
  46  * The following properties may be specified when creating a Zip
  47  * file system:
  48  * <p>
  49  * <table class="striped">
  50  * <caption style="display:none">
  51  *     Configurable properties that may be specified when creating
  52  *     a new Zip file system
  53  * </caption>
  54  * <thead>
  55  * <tr>
  56  * <th scope="col">Property Name</th>
  57  * <th scope="col">Data Type</th>
  58  * <th scope="col">Default Value</th>
  59  * <th scope="col">Description</th>
  60  * </tr>
  61  * </thead>
  62  *
  63  * <tbody>
  64  * <tr>
  65  *   <td scope="row">create</td>
  66  *   <td>java.lang.String</td>
  67  *   <td>false</td>
  68  *   <td>
  69  *       If the value is {@code true}, the Zip file system provider
  70  *       creates a new Zip or JAR file if it does not exist.
  71  *   </td>
  72  * </tr>
  73  * <tr>
  74  *   <td scope="row">encoding</td>
  75  *   <td>java.lang.String</td>
  76  *   <td>UTF-8</td>
  77  *   <td>
  78  *       The value indicates the encoding scheme for the
  79  *       names of the entries in the Zip or JAR file.
  80  *   </td>
  81  * </tr>
  82  * </tbody>
  83  * </table>
  84  *
  85  * <h3>Examples:</h3>
  86  *
  87  * Construct a new Zip file system that is identified by a URI.  If the Zip file does not exist,
  88  * it will be created:
  89  * <pre>
  90  * {@code
  91  *
  92  *     URI uri = URI.create("jar:file:/home/luckydog/tennisTeam.zip");
  93  *     Map<String, String> env = Map.of("create", "true");
  94  *     FileSystem zipfs = FileSystems.newFileSystem(uri, env);
  95  * }
  96  * </pre>
  97  *
  98  * Construct a new Zip file system that is identified by specifying a path
  99  * and using automatic file type detection. Iterate from the root of the JAR displaying each
 100  * found entry:
 101  * <pre>
 102  * {@code
 103  *
 104  *     FileSystem zipfs = FileSystems.newFileSystem(Path.of("helloworld.jar"), null);
 105  *     Path rootDir = zipfs.getPath("/");


   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /**
  27  * Provides the implementation of the Zip file system provider.
  28  * The Zip file system provider treats the contents of a Zip or JAR file as a file system.

  29  *
  30  * <h2>Accessing a Zip File System</h2>
  31  *
  32  * The {@linkplain java.nio.file.FileSystems FileSystems} {@code newFileSystem}
  33  * static factory methods can be used to:
  34  * <ul>
  35  *     <li>Create a Zip file system</li>
  36  *     <li>Open an existing file as a Zip file system</li>
  37  * </ul>
  38  *
  39  * <h3>URI Scheme Used to Identify the Zip File System</h3>
  40  *
  41  * The URI {@link java.net.URI#getScheme scheme} that identifies the ZIP file system is {@code jar}.
  42  *
  43  * <h2>Zip File System Properties</h2>
  44  *
  45  * The following properties may be specified when creating a Zip
  46  * file system:

  47  * <table class="striped">
  48  * <caption style="display:none">
  49  *     Configurable properties that may be specified when creating
  50  *     a new Zip file system
  51  * </caption>
  52  * <thead>
  53  * <tr>
  54  * <th scope="col">Property Name</th>
  55  * <th scope="col">Data Type</th>
  56  * <th scope="col">Default Value</th>
  57  * <th scope="col">Description</th>
  58  * </tr>
  59  * </thead>
  60  *
  61  * <tbody>
  62  * <tr>
  63  *   <td scope="row">create</td>
  64  *   <td>java.lang.String</td>
  65  *   <td>false</td>
  66  *   <td>
  67  *       If the value is {@code true}, the Zip file system provider
  68  *       creates a new Zip or JAR file if it does not exist.
  69  *   </td>
  70  * </tr>
  71  * <tr>
  72  *   <td scope="row">encoding</td>
  73  *   <td>java.lang.String</td>
  74  *   <td>UTF-8</td>
  75  *   <td>
  76  *       The value indicates the encoding scheme for the
  77  *       names of the entries in the Zip or JAR file.
  78  *   </td>
  79  * </tr>
  80  * </tbody>
  81  * </table>
  82  *
  83  * <h2>Examples:</h2>
  84  *
  85  * Construct a new Zip file system that is identified by a URI.  If the Zip file does not exist,
  86  * it will be created:
  87  * <pre>
  88  * {@code
  89  *
  90  *     URI uri = URI.create("jar:file:/home/luckydog/tennisTeam.zip");
  91  *     Map<String, String> env = Map.of("create", "true");
  92  *     FileSystem zipfs = FileSystems.newFileSystem(uri, env);
  93  * }
  94  * </pre>
  95  *
  96  * Construct a new Zip file system that is identified by specifying a path
  97  * and using automatic file type detection. Iterate from the root of the JAR displaying each
  98  * found entry:
  99  * <pre>
 100  * {@code
 101  *
 102  *     FileSystem zipfs = FileSystems.newFileSystem(Path.of("helloworld.jar"), null);
 103  *     Path rootDir = zipfs.getPath("/");
< prev index next >