--- old/src/jdk.zipfs/share/classes/module-info.java 2019-03-20 17:23:29.155484900 +0100 +++ new/src/jdk.zipfs/share/classes/module-info.java 2019-03-20 17:23:28.114580600 +0100 @@ -41,6 +41,34 @@ * * The URI {@link java.net.URI#getScheme scheme} that identifies the ZIP file system is {@code jar}. * + *

Support for POSIX file permissions

+ * + * File systems created by the Zip file system provider have a built in support + * for POSIX permissions. It is possible to query a + * {@link java.nio.file.Path Path} object from a Zip file system for the + * attribute {@code storedPermissions}. The value of the attribute + * will be of type + * {@link java.util.Set}<{@link java.nio.file.attribute.PosixFilePermission}>. + * As POSIX permission information is optional in Zip files, the attribute value + * will be {@code null} in case no permission information exists for a Zip entry.
+ * + * For extended POSIX support, allowing to use + * {@link java.nio.file.attribute.PosixFileAttributeView} and taking advantage + * of {@link java.nio.file.Files#setPosixFilePermissions Files::setPosixFilePermissions} + * or {@link java.nio.file.Files#getPosixFilePermissions Files::getPosixFilePermissions}, + * it is possible to create a Zip file system with the property {@code posix} + * set to {@code true}. + * In that case, certain defaults apply. The owner of a file will be set to a + * {@link java.nio.file.attribute.UserPrincipal} with its name set to the value of + * {@code System.getProperty("user.name")}. The group will be a + * {@link java.nio.file.attribute.GroupPrincipal} with the name "{@code }". + * The default {@link java.util.Set} of permissions for cases when no permission data + * is associated with a Zip file entry, will contain + * {@link java.nio.file.attribute.PosixFilePermission#OWNER_READ OWNER_READ}, + * {@link java.nio.file.attribute.PosixFilePermission#OWNER_WRITE OWNER_WRITE} and + * {@link java.nio.file.attribute.PosixFilePermission#GROUP_READ GROUP_READ}. + * It is possible to override the defaults using properties as specified below. + * *

Zip File System Properties

* * The following properties may be specified when creating a Zip @@ -79,6 +107,45 @@ * names of the entries in the Zip or JAR file. * * + * + * enablePosixFileAttributes + * java.lang.String + * false + * + * If the value is {@code true}, the created Zip file system will support + * the {@link java.nio.file.attribute.PosixFileAttributeView}. + * + * + * + * defaultOwner + * java.nio.file.attribute.UserPrincipal + * A user principal with its name set to the value of System property + * "{@code user.name}" + * + * The value will be the default owner for entries in the Zip + * file system. + * + * + * + * defaultGroup + * java.nio.file.attribute.GroupPrincipal + * A group principal with its name set to "{@code }" + * + * The value will be the default group for entries in the Zip + * file system. + * + * + * + * defaultPermissions + * java.util.Set<{@link java.nio.file.attribute.PosixFilePermission}> + * A set of {@link java.nio.file.attribute.PosixFilePermission#OWNER_READ OWNER_READ}, + * {@link java.nio.file.attribute.PosixFilePermission#OWNER_WRITE OWNER_WRITE} and + * {@link java.nio.file.attribute.PosixFilePermission#GROUP_READ GROUP_READ} + * + * The value will be the default Set of permissions for entries in the Zip + * file system. + * + * * * *