[
https://issues.apache.org/jira/browse/CAMEL-7409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13990746#comment-13990746
]
Serge Shikov commented on CAMEL-7409:
-------------------------------------
Yes, probably ZipInputStream just can't read anything, but ZipFile could detect
such corrupted zips.
What about something like in ZipIterator constructor?
{code}
try {
final ZipFile zipFile= new
ZipFile(inputMessage.getBody(File.class));
final InputStream inputStream =
inputMessage.getBody(InputStream.class);
if (inputStream instanceof ZipInputStream) {
zipInputStream = (ZipInputStream)inputStream;
} else {
zipInputStream = new ZipInputStream(new
BufferedInputStream(inputStream));
}
} catch (ZipException e) {
LOGGER.error("ZipException", e);
zipInputStream= null;
// or throw new RuntimeException("ZipException", e);
} catch (IOException e) {
LOGGER.error("IOException", e);
zipInputStream= null;
// or throw new RuntimeException("IOException", e);
}
{code}
> Camel ZipIterator should not eat the IOException
> ------------------------------------------------
>
> Key: CAMEL-7409
> URL: https://issues.apache.org/jira/browse/CAMEL-7409
> Project: Camel
> Issue Type: Bug
> Affects Versions: 2.13.0
> Reporter: Willem Jiang
> Assignee: Willem Jiang
> Fix For: 2.12.4, 2.13.1, 2.14.0
>
>
> If there are some thing wrong with the Zip file which is split by
> ZipIterator, we cannot find any warning or exception from the camel route. We
> should not let ZipIterator eat up the exception without do anything.
--
This message was sent by Atlassian JIRA
(v6.2#6252)