You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Serge Shikov <sh...@inbox.ru> on 2014/05/03 09:59:24 UTC

Re: zip file best practices

Hi, everybody

Could somebody explain, how are errors handled within ZipSplitter and
ZipFileDataFormat?

Just for example, I have a project where I should receive zip files from
external source via http. 

What if zip central directory was corrupted during transfer? Does this
component check CRC for zip entries?

Just for example - I have tested some use cases with my camel unzipping
route, and found that if I try to unzip something (not a zip archive at
all), I'll get just one message after splitter, and original file as its
body. 

And no exceptions, log messages etc. I don't think this is correct.

Regards

Serge



--
View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5750811.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re[2]: zip file best practices

Posted by Serge Shikov <sh...@inbox.ru>.
 It will be very good also if all ZipEntry fields (see below) will be added to message as headers. 

String name; // entry name
long time = -1; // modification time (in DOS time)
long crc = -1; // crc-32 of entry data
long size = -1; // uncompressed size of entry data
long csize = -1; // compressed size of entry data
int method = -1; // compression method
int flag = 0; // general purpose flag
byte[] extra; // optional extra field data for entry
String comment; // optional comment string for entry

Some of this data could be helpful for processing entries, if available for camel route code. And it should be easy to add - just one line for each field, or even

answer.setHeader("zipEntry", current.clone());
to add entry itself.
Sun, 4 May 2014 02:37:52 -0700 (PDT) от "Claus Ibsen-2 [via Camel]" <ml...@n5.nabble.com>:
>On Sat, May 3, 2014 at 10:08 AM, Serge Shikov < [hidden email] > wrote:
>
>> Here is part of ZipIterator:
>>
>>
>>
>> Note ignored IOException's. I think is should be logged and processed.
>> Probably messages should be generated even if we can't unzip some entries.
>>
>>
>>
>> --
>> View this message in context:  http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5750812.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>Hi
>
>Yeah sounds like we should detect those io exceptions and propagate
>them back so Camel can react. Maybe we can have an option on the zip
>iterator to ignore those exceptions so people can partially read
>corrupted jars.
>
>Fell free to log a JIRA ticket
>http://camel.apache.org/support
>
>
>-- 
>Claus Ibsen
>-----------------
>Red Hat, Inc.
>Email:  [hidden email]
>Twitter: davsclaus
>Blog:  http://davsclaus.com
>Author of Camel in Action:  http://www.manning.com/ibsen
>hawtio:  http://hawt.io/
>fabric8:  http://fabric8.io/
>
>
>----------------------------------------------------------------------
>If you reply to this email, your message will be added to the discussion below: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5750835.html
>To unsubscribe from zip file best practices,  click here .
>NAML




--
View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5750836.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: zip file best practices

Posted by Willem Jiang <wi...@gmail.com>.
I think we should throw the exception out to let the user know there is something wrong with the Zip file. If the ZipIterator eat up the exception, it could be every hard for the user to find out why the camel route doesn’t work as he expects.
 
I just fill a JIRA[1] to throw the exception out from the ZipIterator. 

[1]https://issues.apache.org/jira/browse/CAMEL-7409 

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 4, 2014 at 5:37:18 PM, Claus Ibsen (claus.ibsen@gmail.com) wrote:
> On Sat, May 3, 2014 at 10:08 AM, Serge Shikov wrote:
> > Here is part of ZipIterator:
> >
> >
> >
> > Note ignored IOException's. I think is should be logged and processed.
> > Probably messages should be generated even if we can't unzip some entries.
> >
> >
> >
> > --
> > View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5750812.html  
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>  
> Hi
>  
> Yeah sounds like we should detect those io exceptions and propagate
> them back so Camel can react. Maybe we can have an option on the zip
> iterator to ignore those exceptions so people can partially read
> corrupted jars.
>  
> Fell free to log a JIRA ticket
> http://camel.apache.org/support
>  
>  
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>  


Re: zip file best practices

Posted by Claus Ibsen <cl...@gmail.com>.
On Sat, May 3, 2014 at 10:08 AM, Serge Shikov <sh...@inbox.ru> wrote:
> Here is part of ZipIterator:
>
>
>
> Note ignored IOException's. I think is should be logged and processed.
> Probably messages should be generated even if we can't unzip some entries.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5750812.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Hi

Yeah sounds like we should detect those io exceptions and propagate
them back so Camel can react. Maybe we can have an option on the zip
iterator to ignore those exceptions so people can partially read
corrupted jars.

Fell free to log a JIRA ticket
http://camel.apache.org/support


-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: zip file best practices

Posted by Serge Shikov <sh...@inbox.ru>.
Here is part of ZipIterator:



Note ignored IOException's. I think is should be logged and processed.
Probably messages should be generated even if we can't unzip some entries.



--
View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5750812.html
Sent from the Camel - Users mailing list archive at Nabble.com.