src/jdk.zipfs/share/classes/module-info.java
author stuefe
Fri, 24 May 2019 09:02:33 +0200
changeset 55023 d56d8e40b6cd
parent 53715 6c96d42ec3e7
child 55129 baad58d0cbfe
child 58678 9cf78a70fa4f
permissions -rw-r--r--
8220394: bufferedStream does not honor size limit Reviewed-by: dholmes, clanger
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
53715
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
     2
 * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * accompanied this code).
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    23
 * questions.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    24
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    25
44417
a431edba1629 8173303: Add module-subgraph images to main platform documentation
mchung
parents: 36511
diff changeset
    26
/**
53715
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    27
 * Provides the implementation of the Zip file system provider.
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    28
 * The Zip file system provider treats the contents of a Zip or JAR file as a file system.
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    29
 * <p>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    30
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    31
 * <h3>Accessing a Zip File System</h3>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    32
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    33
 * The {@linkplain java.nio.file.FileSystems FileSystems} {@code newFileSystem}
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    34
 * static factory methods can be used to:
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    35
 * <ul>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    36
 *     <li>Create a Zip file system</li>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    37
 *     <li>Open an existing file as a Zip file system</li>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    38
 * </ul>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    39
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    40
 * <h3>URI Scheme Used to Identify the Zip File System</h3>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    41
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    42
 * The URI {@link java.net.URI#getScheme scheme} that identifies the ZIP file system is {@code jar}.
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    43
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    44
 * <h3>Zip File System Properties</h3>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    45
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    46
 * The following properties may be specified when creating a Zip
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    47
 * file system:
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    48
 * <p>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    49
 * <table class="striped">
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    50
 * <caption style="display:none">
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    51
 *     Configurable properties that may be specified when creating
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    52
 *     a new Zip file system
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    53
 * </caption>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    54
 * <thead>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    55
 * <tr>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    56
 * <th scope="col">Property Name</th>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    57
 * <th scope="col">Data Type</th>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    58
 * <th scope="col">Default Value</th>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    59
 * <th scope="col">Description</th>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    60
 * </tr>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    61
 * </thead>
44417
a431edba1629 8173303: Add module-subgraph images to main platform documentation
mchung
parents: 36511
diff changeset
    62
 *
53715
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    63
 * <tbody>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    64
 * <tr>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    65
 *   <td scope="row">create</td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    66
 *   <td>java.lang.String</td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    67
 *   <td>false</td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    68
 *   <td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    69
 *       If the value is {@code true}, the Zip file system provider
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    70
 *       creates a new Zip or JAR file if it does not exist.
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    71
 *   </td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    72
 * </tr>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    73
 * <tr>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    74
 *   <td scope="row">encoding</td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    75
 *   <td>java.lang.String</td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    76
 *   <td>UTF-8</td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    77
 *   <td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    78
 *       The value indicates the encoding scheme for the
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    79
 *       names of the entries in the Zip or JAR file.
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    80
 *   </td>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    81
 * </tr>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    82
 * </tbody>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    83
 * </table>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    84
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    85
 * <h3>Examples:</h3>
45528
1e8c2f062ad3 8181639: Add tool and services information to module summary
mchung
parents: 44417
diff changeset
    86
 *
53715
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    87
 * Construct a new Zip file system that is identified by a URI.  If the Zip file does not exist,
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    88
 * it will be created:
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    89
 * <pre>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    90
 * {@code
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    91
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    92
 *     URI uri = URI.create("jar:file:/home/luckydog/tennisTeam.zip");
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    93
 *     Map<String, String> env = Map.of("create", "true");
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    94
 *     FileSystem zipfs = FileSystems.newFileSystem(uri, env);
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    95
 * }
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    96
 * </pre>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    97
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    98
 * Construct a new Zip file system that is identified by specifying a path
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
    99
 * and using automatic file type detection. Iterate from the root of the JAR displaying each
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   100
 * found entry:
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   101
 * <pre>
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   102
 * {@code
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   103
 *
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   104
 *     FileSystem zipfs = FileSystems.newFileSystem(Path.of("helloworld.jar"), null);
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   105
 *     Path rootDir = zipfs.getPath("/");
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   106
 *     Files.walk(rootDir)
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   107
 *            .forEach(System.out::println);
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   108
 * }
6c96d42ec3e7 8182117: Document Zip File System Properties
lancea
parents: 47216
diff changeset
   109
 * </pre>
45528
1e8c2f062ad3 8181639: Add tool and services information to module summary
mchung
parents: 44417
diff changeset
   110
 * @provides java.nio.file.spi.FileSystemProvider
44417
a431edba1629 8173303: Add module-subgraph images to main platform documentation
mchung
parents: 36511
diff changeset
   111
 * @moduleGraph
a431edba1629 8173303: Add module-subgraph images to main platform documentation
mchung
parents: 36511
diff changeset
   112
 * @since 9
a431edba1629 8173303: Add module-subgraph images to main platform documentation
mchung
parents: 36511
diff changeset
   113
 */
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   114
module jdk.zipfs {
45654
5ff2edfa03fc 8182416: Clean up module-info.java like move requires transitive adjacent to exports
mchung
parents: 45528
diff changeset
   115
    provides java.nio.file.spi.FileSystemProvider with
5ff2edfa03fc 8182416: Clean up module-info.java like move requires transitive adjacent to exports
mchung
parents: 45528
diff changeset
   116
        jdk.nio.zipfs.ZipFileSystemProvider;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   117
}