You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/04/07 17:00:07 UTC

[commons-compress] branch master updated: org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getLocalHeaderOffset()

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new 2005827c org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getLocalHeaderOffset()
2005827c is described below

commit 2005827ce657b84c308886fabf8ad59ca1920e0e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Apr 7 13:00:05 2023 -0400

    org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getLocalHeaderOffset()
---
 pom.xml                                            |  4 +--
 src/changes/changes.xml                            |  5 ++--
 .../compress/archivers/zip/ZipArchiveEntry.java    | 33 +++++++++++++---------
 3 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/pom.xml b/pom.xml
index 06e56956..2be60c90 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
   </parent>
 
   <artifactId>commons-compress</artifactId>
-  <version>1.23.1-SNAPSHOT</version>
+  <version>1.24.0-SNAPSHOT</version>
   <name>Apache Commons Compress</name>
   <url>https://commons.apache.org/proper/commons-compress/</url>
   <inceptionYear>2002</inceptionYear> <!-- from NOTICE file -->
@@ -48,7 +48,7 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
     <commons.release.version>${project.version}</commons.release.version>
     <commons.rc.version>RC1</commons.rc.version>
     <!-- old version used by japicmp -->
-    <commons.bc.version>1.22</commons.bc.version>
+    <commons.bc.version>1.23.0</commons.bc.version>
     <mockito.version>4.11.0</mockito.version>
 
     <commons.release.isDistModule>true</commons.release.isDistModule>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b2ac5375..d30fdb1d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -44,8 +44,9 @@ The <action> type attribute can be add,update,fix,remove.
     <title>Apache Commons Compress Release Notes</title>
   </properties>
   <body>
-    <release version="1.23.1" date="202Y-MM-DD">
-      <action type="update" dev="kinow" due-to="Dependabot">Bump zstd-jni from 1.5.4-2 to 1.5.5-1 #377</action>
+    <release version="1.24.0" date="202Y-MM-DD">
+      <action type="update" dev="kinow" due-to="Gary Gregory">Make ZipArchiveEntry.getLocalHeaderOffset() public.</action>
+      <action type="update" dev="kinow" due-to="Dependabot">Bump zstd-jni from 1.5.4-2 to 1.5.5-1 #377.</action>
     </release>
     <release version="1.23.0" date="2023-03-18">
       <!-- FIX -->
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
index 20abb9fc..2af3a402 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
@@ -610,7 +610,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * Looks up an extra field by its header id.
+     * Gets an extra field by its header id.
      *
      * @param type the header id
      * @return null if no such field exists.
@@ -627,7 +627,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * Retrieves all extra fields that have been parsed successfully.
+     * Gets all extra fields that have been parsed successfully.
      *
      * <p><b>Note</b>: The set of extra fields may be incomplete when
      * {@link ZipArchiveInputStream} has been used as some extra
@@ -641,7 +641,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * Retrieves extra fields.
+     * Gets extra fields.
      * @param includeUnparseable whether to also return unparseable
      * extra fields as {@link UnparseableExtraFieldData} if such data
      * exists.
@@ -656,13 +656,12 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * Retrieves extra fields.
+     * Gets extra fields.
+     *
      * @param parsingBehavior controls parsing of extra fields.
      * @return an array of the extra fields
-     *
      * @throws ZipException if parsing fails, can not happen if {@code
      * parsingBehavior} is {@link ExtraFieldParsingMode#BEST_EFFORT}.
-     *
      * @since 1.19
      */
     public ZipExtraField[] getExtraFields(final ExtraFieldParsingBehavior parsingBehavior)
@@ -710,7 +709,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * Retrieves the internal file attributes.
+     * Gets the internal file attributes.
      *
      * <p><b>Note</b>: {@link ZipArchiveInputStream} is unable to fill
      * this field, you must use {@link ZipFile} if you want to read
@@ -736,7 +735,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * Retrieves the extra data for the local file data.
+     * Gets the extra data for the local file data.
      * @return the extra data for local file
      */
     public byte[] getLocalFileDataExtra() {
@@ -744,7 +743,13 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
         return extra != null ? extra : ByteUtils.EMPTY_BYTE_ARRAY;
     }
 
-    protected long getLocalHeaderOffset() {
+    /**
+     * Gets the local header offset.
+     *
+     * @return the local header offset.
+     * @since 1.24.0
+     */
+    public long getLocalHeaderOffset() {
         return this.localHeaderOffset;
     }
 
@@ -755,7 +760,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * Returns the compression method of this entry, or -1 if the
+     * Gets the compression method of this entry, or -1 if the
      * compression method has not been specified.
      *
      * @return compression method
@@ -872,7 +877,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * Unix permission.
+     * Gets the Unix permission.
      * @return the unix permissions
      */
     public int getUnixMode() {
@@ -881,7 +886,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * Looks up extra field data that couldn't be parsed correctly.
+     * Gets up extra field data that couldn't be parsed correctly.
      *
      * @return null if no such field exists.
      *
@@ -896,7 +901,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * The "version made by" field.
+     * Gets the "version made by" field.
      * @return "version made by" field
      * @since 1.11
      */
@@ -905,7 +910,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
     }
 
     /**
-     * The "version required to expand" field.
+     * Gets the "version required to expand" field.
      * @return "version required to expand" field
      * @since 1.11
      */