You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2019/08/17 10:41:04 UTC
[commons-compress] branch master updated: COMPRESS-479 document the
change in zip extra field parsing
This is an automated email from the ASF dual-hosted git repository.
bodewig 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 9584bcf COMPRESS-479 document the change in zip extra field parsing
9584bcf is described below
commit 9584bcfd7105761d2c0b885f1042ad0d26b15b68
Author: Stefan Bodewig <bo...@apache.org>
AuthorDate: Sat Aug 17 12:40:33 2019 +0200
COMPRESS-479 document the change in zip extra field parsing
---
src/changes/changes.xml | 26 +++++++++++++++++++++++++-
src/site/xdoc/zip.xml | 11 ++++++++++-
2 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index aacc9a1..c9f2e8c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -43,7 +43,21 @@ The <action> type attribute can be add,update,fix,remove.
</properties>
<body>
<release version="1.19" date="not released, yet"
- description="Release 1.19">
+ description="Release 1.19
+----------------------------------------
+
+ZipArchiveInputStream and ZipFile will no longer throw an exception if
+an extra field generally understood by Commons Compress is malformed
+but rather turn them into UnrecognizedExtraField instances.
+You can influence the way extra fields are parsed in more detail by
+using the new getExtraFields(ExtraFieldParsingBehavior) method of
+ZipArchiveEntry now.
+
+Some of the ZIP extra fields related to strong encryption will now
+throw ZipExceptions rather than ArrayIndexOutOfBoundsExceptions in
+certain cases when used directly. There is no practical difference
+when they are read via ZipArchiveInputStream or ZipFile.
+">
<action type="fix" date="2018-09-07">
ZipArchiveInputStream could forget the compression level has
changed under certain circumstances.
@@ -103,6 +117,16 @@ The <action> type attribute can be add,update,fix,remove.
give the calling code a chance to deal with those wrapper
resources.
</action>
+ <action type="update" date="2019-08-16" issue="COMPRESS-479">
+ ZipArchiveInputStream and ZipFile no longer assume Commons
+ Compress would understand extra fields better than the writer
+ of the archive and silently turn extra fields that Commons
+ Compress should understand into UnrecognizedExtraFields if
+ parsing said fields fails.
+ It is now possible to take more control over the extra field
+ parsing process with a new overload of
+ ZipArchiveEntry#getExtraFields.
+ </action>
</release>
<release version="1.18" date="2018-08-16"
description="Release 1.18">
diff --git a/src/site/xdoc/zip.xml b/src/site/xdoc/zip.xml
index bad3a26..855537f 100644
--- a/src/site/xdoc/zip.xml
+++ b/src/site/xdoc/zip.xml
@@ -152,7 +152,7 @@
<p>Actually the extra data is supposed to be more structured
than that and Compress' ZIP package provides access to the
- structured data as <code>ExtraField</code> instances. Only
+ structured data as <code>ZipExtraField</code> instances. Only
a subset of all defined extra field formats is supported by
the package, any other extra field will be stored
as <code>UnrecognizedExtraField</code>.</p>
@@ -164,6 +164,15 @@
will now be read
as <code>UnparseableExtraFieldData</code>.</p>
+ <p>Prior to version 1.19 of this library trying to read an
+ archive with extra fields that Compress expects to
+ understand but that used a different content than expected
+ would cause Compress to throw an exception. Starting with
+ version 1.19 these extra fields will now be read as
+ <code>UnrecognizedExtraField</code>. Using
+ <code>ZipArchiveEntry.getExtraFields(ExtraFieldParsingBehavior)</code>
+ you have a more fine grained control over the parser.</p>
+
</subsection>
<subsection name="Encoding" id="encoding">