diff --git a/src/java.base/share/classes/java/util/jar/JarFile.java b/src/java.base/share/classes/java/util/jar/JarFile.java index ca8c726129e..77dfed3b84f 100644 --- a/src/java.base/share/classes/java/util/jar/JarFile.java +++ b/src/java.base/share/classes/java/util/jar/JarFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -826,7 +826,7 @@ public class JarFile extends ZipFile { /** * Returns an input stream for reading the contents of the specified - * zip file entry. + * ZIP file entry. * * @apiNote The {@code InputStream} returned by this method can wrap an * {@link java.util.zip.InflaterInputStream InflaterInputStream}, whose @@ -834,11 +834,11 @@ public class JarFile extends ZipFile { * read(byte[], int, int)} method can modify any element of the output * buffer. * - * @param ze the zip file entry + * @param ze the ZIP file entry * @return an input stream for reading the contents of the specified - * zip file entry or null if the zip file entry does not exist + * ZIP file entry or null if the ZIP file entry does not exist * within the jar file - * @throws ZipException if a zip file format error has occurred + * @throws ZipException if a ZIP file format error has occurred * @throws IOException if an I/O error has occurred * @throws SecurityException if any of the jar file entries * are incorrectly signed. diff --git a/src/java.base/share/classes/java/util/zip/ZipCoder.java b/src/java.base/share/classes/java/util/zip/ZipCoder.java index 8696d2a797e..6eb97308832 100644 --- a/src/java.base/share/classes/java/util/zip/ZipCoder.java +++ b/src/java.base/share/classes/java/util/zip/ZipCoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ import jdk.internal.util.ArraysSupport; import sun.nio.cs.UTF_8; /** - * Utility class for zipfile name and comment decoding and encoding + * Utility class for ZIP file entry name and comment decoding and encoding */ class ZipCoder { diff --git a/src/java.base/share/classes/java/util/zip/ZipConstants.java b/src/java.base/share/classes/java/util/zip/ZipConstants.java index 9eac888abc9..b3f07f901ab 100644 --- a/src/java.base/share/classes/java/util/zip/ZipConstants.java +++ b/src/java.base/share/classes/java/util/zip/ZipConstants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -230,7 +230,7 @@ interface ZipConstants { static final int ENDOFF = 16; /** - * End of central directory (END) header zip file comment length field offset. + * End of central directory (END) header ZIP file comment length field offset. */ static final int ENDCOM = 20; } diff --git a/src/java.base/share/classes/java/util/zip/ZipEntry.java b/src/java.base/share/classes/java/util/zip/ZipEntry.java index 7a09836fa83..85bd6155fa8 100644 --- a/src/java.base/share/classes/java/util/zip/ZipEntry.java +++ b/src/java.base/share/classes/java/util/zip/ZipEntry.java @@ -93,7 +93,7 @@ public class ZipEntry implements ZipConstants, Cloneable { 128L * 365 * 24 * 60 * 60 * 1000; /** - * Creates a new zip entry with the specified name. + * Creates a new ZIP entry with the specified name. * * @param name * The entry name @@ -111,11 +111,11 @@ public class ZipEntry implements ZipConstants, Cloneable { } /** - * Creates a new zip entry with fields taken from the specified - * zip entry. + * Creates a new ZIP entry with fields taken from the specified + * ZIP entry. * * @param e - * A zip Entry object + * A ZIP Entry object * * @throws NullPointerException if the entry object is null */ @@ -150,7 +150,7 @@ public class ZipEntry implements ZipConstants, Cloneable { * *
If the entry is output to a ZIP file or ZIP file formatted * output stream the last modification time set by this method will - * be stored into the {@code date and time fields} of the zip file + * be stored into the {@code date and time fields} of the ZIP file * entry and encoded in standard {@code MS-DOS date and time format}. * The {@link java.util.TimeZone#getDefault() default TimeZone} is * used to convert the epoch time to the MS-DOS date and time. @@ -183,7 +183,7 @@ public class ZipEntry implements ZipConstants, Cloneable { * *
If the entry is read from a ZIP file or ZIP file formatted * input stream, this is the last modification time from the {@code - * date and time fields} of the zip file entry. The + * date and time fields} of the ZIP file entry. The * {@link java.util.TimeZone#getDefault() default TimeZone} is used * to convert the standard MS-DOS formatted date and time to the * epoch time. @@ -206,11 +206,11 @@ public class ZipEntry implements ZipConstants, Cloneable { * *
If the entry is output to a ZIP file or ZIP file formatted * output stream the last modification time set by this method will - * be stored into the {@code date and time fields} of the zip file + * be stored into the {@code date and time fields} of the ZIP file * entry and encoded in standard {@code MS-DOS date and time format}. * If the date-time set is out of the range of the standard {@code * MS-DOS date and time format}, the time will also be stored into - * zip file entry's extended timestamp fields in {@code optional + * ZIP file entry's extended timestamp fields in {@code optional * extra data} in UTC time. The {@link java.time.ZoneId#systemDefault() * system default TimeZone} is used to convert the local date-time * to UTC time. @@ -285,13 +285,13 @@ public class ZipEntry implements ZipConstants, Cloneable { * *
When output to a ZIP file or ZIP file formatted output stream * the last modification time set by this method will be stored into - * zip file entry's {@code date and time fields} in {@code standard + * ZIP file entry's {@code date and time fields} in {@code standard * MS-DOS date and time format}), and the extended timestamp fields * in {@code optional extra data} in UTC time. * * @param time * The last modification time of the entry - * @return This zip entry + * @return This ZIP entry * * @throws NullPointerException if the {@code time} is null * @@ -337,7 +337,7 @@ public class ZipEntry implements ZipConstants, Cloneable { * * @param time * The last access time of the entry - * @return This zip entry + * @return This ZIP entry * * @throws NullPointerException if the {@code time} is null * @@ -373,7 +373,7 @@ public class ZipEntry implements ZipConstants, Cloneable { * * @param time * The creation time of the entry - * @return This zip entry + * @return This ZIP entry * * @throws NullPointerException if the {@code time} is null * diff --git a/src/java.base/share/classes/java/util/zip/ZipException.java b/src/java.base/share/classes/java/util/zip/ZipException.java index 45048a4254b..8c4f96ccbb7 100644 --- a/src/java.base/share/classes/java/util/zip/ZipException.java +++ b/src/java.base/share/classes/java/util/zip/ZipException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ package java.util.zip; import java.io.IOException; /** - * Signals that a Zip exception of some sort has occurred. + * Signals that a ZIP exception of some sort has occurred. * * @see java.io.IOException * @since 1.1 diff --git a/src/java.base/share/classes/java/util/zip/ZipFile.java b/src/java.base/share/classes/java/util/zip/ZipFile.java index cb79194e6df..4f4c410a83e 100644 --- a/src/java.base/share/classes/java/util/zip/ZipFile.java +++ b/src/java.base/share/classes/java/util/zip/ZipFile.java @@ -76,7 +76,7 @@ import static java.util.zip.ZipConstants64.*; import static java.util.zip.ZipUtils.*; /** - * This class is used to read entries from a zip file. + * This class is used to read entries from a ZIP file. * *
Unless otherwise noted, passing a {@code null} argument to a constructor * or method in this class will cause a {@link NullPointerException} to be @@ -95,27 +95,27 @@ import static java.util.zip.ZipUtils.*; */ public class ZipFile implements ZipConstants, Closeable { - private final String filePath; // zip file path + private final String filePath; // ZIP file path private final String fileName; // name of the file private volatile boolean closeRequested; - // The "resource" used by this zip file that needs to be + // The "resource" used by this ZIP file that needs to be // cleaned after use. // a) the input streams that need to be closed // b) the list of cached Inflater objects - // c) the "native" source of this zip file. + // c) the "native" source of this ZIP file. private final @Stable CleanableResource res; private static final int STORED = ZipEntry.STORED; private static final int DEFLATED = ZipEntry.DEFLATED; /** - * Mode flag to open a zip file for reading. + * Mode flag to open a ZIP file for reading. */ public static final int OPEN_READ = 0x1; /** - * Mode flag to open a zip file and mark it for deletion. The file will be + * Mode flag to open a ZIP file and mark it for deletion. The file will be * deleted some time between the moment that it is opened and the moment * that it is closed, but its contents will remain accessible via the * {@code ZipFile} object until either the close method is invoked or the @@ -131,7 +131,7 @@ public class ZipFile implements ZipConstants, Closeable { getDisableZip64ExtraFieldValidation(); /** - * Opens a zip file for reading. + * Opens a ZIP file for reading. * *
First, if there is a security manager, its {@code checkRead} * method is called with the {@code name} argument as its argument @@ -140,7 +140,7 @@ public class ZipFile implements ZipConstants, Closeable { *
The UTF-8 {@link java.nio.charset.Charset charset} is used to * decode the entry names and comments. * - * @param name the name of the zip file + * @param name the name of the ZIP file * @throws ZipException if a ZIP format error has occurred * @throws IOException if an I/O error has occurred * @throws SecurityException if a security manager exists and its @@ -258,13 +258,13 @@ public class ZipFile implements ZipConstants, Closeable { } /** - * Opens a zip file for reading. + * Opens a ZIP file for reading. * *
First, if there is a security manager, its {@code checkRead} * method is called with the {@code name} argument as its argument * to ensure the read is allowed. * - * @param name the name of the zip file + * @param name the name of the ZIP file * @param charset * the {@linkplain java.nio.charset.Charset charset} to * be used to decode the ZIP entry name and comment that are not @@ -308,13 +308,13 @@ public class ZipFile implements ZipConstants, Closeable { } /** - * Returns the zip file comment. If a comment does not exist or an error is + * Returns the ZIP file comment. If a comment does not exist or an error is * encountered decoding the comment using the charset specified - * when opening the Zip file, then {@code null} is returned. + * when opening the ZIP file, then {@code null} is returned. * - * @return the comment string for the zip file, or null if none + * @return the comment string for the ZIP file, or null if none * - * @throws IllegalStateException if the zip file has been closed + * @throws IllegalStateException if the ZIP file has been closed * * @since 1.7 */ @@ -325,7 +325,7 @@ public class ZipFile implements ZipConstants, Closeable { return null; } // If there is a problem decoding the byte array which represents - // the Zip file comment, return null; + // the ZIP file comment, return null; try { return res.zsrc.zc.toString(res.zsrc.comment); } catch (IllegalArgumentException iae) { @@ -335,12 +335,12 @@ public class ZipFile implements ZipConstants, Closeable { } /** - * Returns the zip file entry for the specified name, or null + * Returns the ZIP file entry for the specified name, or null * if not found. * * @param name the name of the entry - * @return the zip file entry, or null if not found - * @throws IllegalStateException if the zip file has been closed + * @return the ZIP file entry, or null if not found + * @throws IllegalStateException if the ZIP file has been closed */ public ZipEntry getEntry(String name) { Objects.requireNonNull(name, "name"); @@ -357,7 +357,7 @@ public class ZipFile implements ZipConstants, Closeable { /** * Returns an input stream for reading the contents of the specified - * zip file entry. + * ZIP file entry. *
* Closing this ZIP file will, in turn, close all input streams that
* have been returned by invocations of this method.
@@ -368,13 +368,13 @@ public class ZipFile implements ZipConstants, Closeable {
* read(byte[], int, int)} method can modify any element of the output
* buffer.
*
- * @param entry the zip file entry
+ * @param entry the ZIP file entry
* @return the input stream for reading the contents of the specified
- * zip file entry or null if the zip file entry does not exist
- * within the zip file.
+ * ZIP file entry or null if the ZIP file entry does not exist
+ * within the ZIP file.
* @throws ZipException if a ZIP format error has occurred
* @throws IOException if an I/O error has occurred
- * @throws IllegalStateException if the zip file has been closed
+ * @throws IllegalStateException if the ZIP file has been closed
*/
public InputStream getInputStream(ZipEntry entry) throws IOException {
Objects.requireNonNull(entry, "entry");
@@ -553,7 +553,7 @@ public class ZipFile implements ZipConstants, Closeable {
/**
* Returns an enumeration of the ZIP file entries.
* @return an enumeration of the ZIP file entries
- * @throws IllegalStateException if the zip file has been closed
+ * @throws IllegalStateException if the ZIP file has been closed
*/
public Enumeration extends ZipEntry> entries() {
synchronized (this) {
@@ -605,7 +605,7 @@ public class ZipFile implements ZipConstants, Closeable {
* the central directory of the ZIP file.
*
* @return an ordered {@code Stream} of entries in this ZIP file
- * @throws IllegalStateException if the zip file has been closed
+ * @throws IllegalStateException if the ZIP file has been closed
* @since 1.8
*/
public Stream extends ZipEntry> stream() {
@@ -624,13 +624,13 @@ public class ZipFile implements ZipConstants, Closeable {
}
/*
- * Returns an ordered {@code Stream} over the zip file entry names.
+ * Returns an ordered {@code Stream} over the ZIP file entry names.
*
* Entry names appear in the {@code Stream} in the order they appear in
* the central directory of the ZIP file.
*
- * @return an ordered {@code Stream} of entry names in this zip file
- * @throws IllegalStateException if the zip file has been closed
+ * @return an ordered {@code Stream} of entry names in this ZIP file
+ * @throws IllegalStateException if the ZIP file has been closed
* @since 10
*/
private Stream The "permissions" attribute may be read and set using the
@@ -92,12 +92,12 @@ import java.util.Set;
* }
* }
*
- * In addition to the "{@code zip}" view, a Zip file system optionally supports
+ * In addition to the "{@code zip}" view, a ZIP file system optionally supports
* the {@link PosixFileAttributeView} ("{@code posix}").
* This view extends the "{@code basic}" view with type safe access to the
* {@link PosixFileAttributes#owner() owner}, {@link PosixFileAttributes#group() group-owner},
* and {@link PosixFileAttributes#permissions() permissions} attributes. The
- * "{@code posix}" view is only supported when the Zip file system is created with
+ * "{@code posix}" view is only supported when the ZIP file system is created with
* the provider property "{@code enablePosixFileAttributes}" set to "{@code true}".
* The following creates a file system with this property and reads the access
* permissions of a file:
@@ -110,16 +110,16 @@ import java.util.Set;
* }
*
* The file owner and group owner attributes are not persisted, meaning they are
- * not stored in the zip file. The "{@code defaultOwner}" and "{@code defaultGroup}"
+ * not stored in the ZIP file. The "{@code defaultOwner}" and "{@code defaultGroup}"
* provider properties (listed below) can be used to configure the default values
* for these attributes. If these properties are not set then the file owner
- * defaults to the owner of the zip file, and the group owner defaults to the
- * zip file's group owner (or the file owner on platforms that don't support a
+ * defaults to the owner of the ZIP file, and the group owner defaults to the
+ * ZIP file's group owner (or the file owner on platforms that don't support a
* group owner).
*
* The "{@code permissions}" attribute is not optional in the "{@code posix}"
* view so a default set of permissions are used for entries that do not have
- * access permissions stored in the Zip file. The default set of permissions
+ * access permissions stored in the ZIP file. The default set of permissions
* are
* Accessing a Zip File System
+ * Accessing a ZIP File System
*
* The {@linkplain java.nio.file.FileSystems FileSystems} {@code newFileSystem}
* static factory methods can be used to:
*
- *
*
- * The Zip file system provider does not support opening an existing Zip file
+ * The ZIP file system provider does not support opening an existing ZIP file
* that contains entries with "." or ".." in its name elements.
*
- * URI Scheme Used to Identify the Zip File System
+ * URI Scheme Used to Identify the ZIP File System
*
* The URI {@link java.net.URI#getScheme scheme} that identifies the ZIP file system is {@code jar}.
*
* POSIX file attributes
*
- * A Zip file system supports a file attribute {@link FileAttributeView view}
+ * A ZIP file system supports a file attribute {@link FileAttributeView view}
* named "{@code zip}" that defines the following file attribute:
*
*
@@ -76,8 +76,8 @@ import java.util.Set;
*
*
* The "permissions" attribute is the set of access permissions that are optionally
- * stored for entries in a Zip file. The value of the attribute is {@code null}
- * for entries that do not have access permissions. Zip file systems do not
+ * stored for entries in a ZIP file. The value of the attribute is {@code null}
+ * for entries that do not have access permissions. ZIP file systems do not
* enforce access permissions.
*
*
*
Zip File System Properties
+ * ZIP File System Properties
*
* The following properties may be specified when creating a Zip
* file system:
*
*
*
*
@@ -153,8 +153,8 @@ import java.util.Set;
*
* {@link java.lang.String} or {@link java.lang.Boolean}
* false
*
- * If the value is {@code true}, the Zip file system provider
- * creates a new Zip or JAR file if it does not exist.
+ * If the value is {@code true}, the ZIP file system provider
+ * creates a new ZIP or JAR file if it does not exist.
*
*
@@ -163,7 +163,7 @@ import java.util.Set;
*
* UTF-8
*
* The value indicates the encoding scheme for the
- * names of the entries in the Zip or JAR file.
+ * names of the entries in the ZIP or JAR file.
*
*
@@ -171,7 +171,7 @@ import java.util.Set;
*
@@ -181,7 +181,7 @@ import java.util.Set;
* {@link java.lang.String}
* {@link java.lang.String} or {@link java.lang.Boolean}
* false
*
- * If the value is {@code true}, the Zip file system will support
+ * If the value is {@code true}, the ZIP file system will support
* the {@link java.nio.file.attribute.PosixFileAttributeView PosixFileAttributeView}.
*
* null/unset
*
- * Override the default owner for entries in the Zip file system.
*
@@ -191,7 +191,7 @@ import java.util.Set;
* {@link java.lang.String}
*
+ * Override the default owner for entries in the ZIP file system.
* The value can be a UserPrincipal or a String value that is used as the UserPrincipal's name.
* null/unset
*
- * Override the default group for entries in the Zip file system.
*
@@ -201,7 +201,7 @@ import java.util.Set;
* or {@link java.lang.String}
*
+ * Override the default group for entries in the ZIP file system.
* The value can be a GroupPrincipal or a String value that is used as the GroupPrincipal's name.
* null/unset
*
- * Override the default Set of permissions for entries in the Zip file system.
@@ -212,16 +212,16 @@ import java.util.Set;
*
+ * Override the default Set of permissions for entries in the ZIP file system.
* The value can be a {@link java.util.Set Set}<{@link java.nio.file.attribute.PosixFilePermission PosixFilePermission}> or
* a String that is parsed by {@link java.nio.file.attribute.PosixFilePermissions#fromString PosixFilePermissions::fromString}
* "DEFLATED"
*
* The value representing the compression method to use when writing entries
- * to the Zip file system.
+ * to the ZIP file system.
*
*
Examples:
*
- * Construct a new Zip file system that is identified by a URI. If the Zip file does not exist,
+ * Construct a new ZIP file system that is identified by a URI. If the ZIP file does not exist,
* it will be created:
*
* {@code
@@ -281,7 +281,7 @@ import java.util.Set;
* }
*
*
- * Construct a new Zip file system that is identified by specifying a path
+ * Construct a new ZIP file system that is identified by specifying a path
* and using automatic file type detection. Iterate from the root of the JAR displaying each
* found entry:
*