You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Benjamin Graf (Jira)" <ji...@apache.org> on 2025/09/07 15:07:00 UTC

[jira] [Commented] (CAMEL-22400) camel-zipfile - Add support for empty zip files / entries

    [ https://issues.apache.org/jira/browse/CAMEL-22400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18018664#comment-18018664 ] 

Benjamin Graf commented on CAMEL-22400:
---------------------------------------

Actually, commons-compress does interpret every file < 22 bytes as empty zip file, returning {{null}} for first entry. The ZipFileSplitIteratorCorruptTest is using a 14 bytes long file, which does throw/except an {{IllegalStateException}} instead of wrapped {{ZipException}} which is thrown for "really" corrupted files. IMHO the best solution is to interpret the first entry returned as {{null}} value as an empty zip file and everything else would be thrown as {{ZipException}} if broken. So no need for the manual {{IllegalStateException}}.

Fits for you [~davsclaus]?

> camel-zipfile - Add support for empty zip files / entries
> ---------------------------------------------------------
>
>                 Key: CAMEL-22400
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22400
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-zipfile
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.x
>
>
> actually camel-zipfile (ZipIterator) does interpret empty zip files as corrupt
> (throwing IllegalStateException("Unable to unzip the file, it may be
> corrupted.")). If this behavior is intended it should be documented, otherwise
> even empty zip files could be handled, like iterating an empty collection.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)