You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gardella juan <ga...@gmail.com> on 2013/03/04 15:05:00 UTC

Re: zip file best practices

The source code has a bug. I fixed it and I want to contribute because the
solution is based in alexey-s solution. I 've attached the source code.

camel-zipsplitter.zip
<http://camel.465427.n5.nabble.com/file/n5728454/camel-zipsplitter.zip>  

Thanks,
Juan 



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

Re: zip file best practices

Posted by Henryk Konsek <he...@gmail.com>.
Hi Juan,

> Thanks for the suggestion, i will try.

If you encounter any problems with extending ZipFile Data Format, just
drop us a line here.

Best regards.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: zip file best practices

Posted by Gardella juan <ga...@gmail.com>.
Thanks for the suggestion, i will try.


2013/3/8 hekonsek [via Camel] <ml...@n5.nabble.com>

> Hi guys,
>
> > Puff, sorry. The Jira is
> https://issues.apache.org/jira/browse/CAMEL-6139
>
> Actually we already got ZipFile component [1], however it supports
> only single-entry zip files at the moment.
>
> Instead of creating separated module with zip file splitter I suggest
> to add multi-entry zip files support to the
> ZipFileDataFormat#unmarshal method, which could just return the
> iterator. We would be able to split zip file as follows then...
>
> from("direct:multi-entry-zip-file").unmarshal().zip().split().to("direct:single-zip-entry");
>
>
> Are there any particular reasons against reusing and improving
> existing ZipFile data format?
>
> Best regards.
>
> [1] http://camel.apache.org/zip-dataformat.html
>
> --
> Henryk Konsek
> http://henryk-konsek.blogspot.com
>
>
> ------------------------------
>  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-tp5713437p5728846.html
>  To unsubscribe from zip file best practices, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5713437&code=Z2FyZGVsbGFqdWFucGFibG9AZ21haWwuY29tfDU3MTM0Mzd8LTE1MjMxMTI5MDU=>
> .
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




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

Re: zip file best practices

Posted by Gardella juan <ga...@gmail.com>.
I suppose yes and more simple to use!

Currently I don't have time to improve the solution. If you know how to do,
please attach a path or vote ignore the patch in the ticket.

Regards,
Juan


2013/3/15 hekonsek [via Camel] <ml...@n5.nabble.com>

> > Otherwise its hard for our end users
> > to know such functionality exists.
>
> Is there any particular reason to provide separated splitter in
> camel-core instead of enhancing existing ZipFile Data Format? Am I
> missing something? :) The following snippet would look just perfect
> for me...
>
> from(...).unmarshal().zipFile().split(body(Iterable.class)).to(...)
>
> In my humble opinion ZipFile data format is responsible for handle
> ZipEntry streams, so we shouldn't create ZipSplitter in camel-core but
> rather improve existing ZipFile code.
>
> Best regards.
>
> --
> Henryk Konsek
> http://henryk-konsek.blogspot.com
>
>
> ------------------------------
>  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-tp5713437p5729266.html
>  To unsubscribe from zip file best practices, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5713437&code=Z2FyZGVsbGFqdWFucGFibG9AZ21haWwuY29tfDU3MTM0Mzd8LTE1MjMxMTI5MDU=>
> .
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




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

Re: zip file best practices

Posted by Henryk Konsek <he...@gmail.com>.
Hi Willem,

> So it make sense to create the Iterator of ZipEntry inside the ZipFile DataFormat.
> I will revisit the patch again and move the code to camel-zipfile module.

If I found some spare time I'll help you with this by enhancing
ZipFile data format.

Good to see agreement on this issue :) .

Best regards.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: zip file best practices

Posted by Willem jiang <wi...@gmail.com>.
Hi Henryk,

I'm sorry I just checked the code Zip data format before I applied patch.
I cannot agree with you more after checking the code of ZipFile DataFormat.
Current ZipFile DataFormat doesn't support to unmarshal the Zip file which has more than one entry.
So it make sense to create the Iterator of ZipEntry inside the ZipFile DataFormat.

I will revisit the patch again and move the code to camel-zipfile module.  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Saturday, March 16, 2013 at 4:27 AM, Henryk Konsek wrote:

> > Otherwise its hard for our end users
> > to know such functionality exists.
>  
>  
>  
> Is there any particular reason to provide separated splitter in
> camel-core instead of enhancing existing ZipFile Data Format? Am I
> missing something? :) The following snippet would look just perfect
> for me...
>  
> from(...).unmarshal().zipFile().split(body(Iterable.class)).to(...)
>  
> In my humble opinion ZipFile data format is responsible for handle
> ZipEntry streams, so we shouldn't create ZipSplitter in camel-core but
> rather improve existing ZipFile code.
>  
> Best regards.
>  
> --
> Henryk Konsek
> http://henryk-konsek.blogspot.com




Re: zip file best practices

Posted by Henryk Konsek <he...@gmail.com>.
> Otherwise its hard for our end users
> to know such functionality exists.

Is there any particular reason to provide separated splitter in
camel-core instead of enhancing existing ZipFile Data Format? Am I
missing something? :) The following snippet would look just perfect
for me...

from(...).unmarshal().zipFile().split(body(Iterable.class)).to(...)

In my humble opinion ZipFile data format is responsible for handle
ZipEntry streams, so we shouldn't create ZipSplitter in camel-core but
rather improve existing ZipFile code.

Best regards.

--
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: zip file best practices

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Mar 13, 2013 at 3:32 AM, Willem.Jiang <wi...@gmail.com> wrote:
> I just have a chance to check the code, it is not a new component.
> I think we can treat it as an expression, which can help the splitter to
> build a Iterator from the uncompressed stream. And it is mainly used with
> split DSL.
>
> Willem
>

I suggest to add a nice example in the unit test and use SNIPPET tags
to have this being used as an example we can show in the Camel docs,
such as on the Splitter EIP page. Otherwise its hard for our end users
to know such functionality exists.


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



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: zip file best practices

Posted by alexey-s <al...@mail.ru>.
Can be improved.
I thought it would be interesting to the user to remember the name of the
zip file.
Now ZipItaror not give this information.

answer.getHeaders().putAll(inputMessage.getHeaders());
answer.setHeader("zipFileName", current.getName());
answer.setHeader(Exchange.FILE_NAME, current.getName());

It has been
${header.camelFileName} = archive_file.zip
${header.zipFileName} = attached_file_name

It has become
${header.camelFileName} = attached_file_name
${header.zipFileName} = attached_file_name

What for?


Alexey



--
View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5741856.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.

Re: zip file best practices

Posted by Serge Shikov <sh...@inbox.ru>.
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: zip file best practices

Posted by Henryk Konsek <he...@gmail.com>.
> Yes, that's good idea. I was thinking about writing another processor to
> do this stuff, but maybe better will be to just improve a bit Camel.

Fell free to create a pull request and ping me when it will be ready.
I'll review it and merge to the master on you behalf.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: zip file best practices

Posted by Jakub Bubin <ja...@datax.pl>.
W dniu 2014-03-03 15:47, hekonsek [via Camel] pisze:
> > I spent a day or two trying the zip component. Finally got it working,
>
> Yeah, Zip File component need some improvements. It lacks some
> functionality and is sometimes a bit unintuitive in a usage.

Good to hear that I was right with my guesses.

>
> > but I
> > think there is still one thing to cover in this component: recursive 
> reading
> > entries from zip package.
>
> We love [1] contributors . Our community would highly appreciate
> pull request with such enhancement. I personally think that we don't
> even need 'recursive' option - we can just automatically detected if
> given zip entry is a directory or file.

Yes, that's good idea. I was thinking about writing another processor to 
do this stuff, but maybe better will be to just improve a bit Camel.

Cheers

-- 
DATAX Sp. z o.o., ul. Fabryczna 10, 53-609 Wrocław, Poland, NIP PL 522-01-00-172
Sąd Rejestrowy dla Wrocławia - Fabrycznej, VI Wydz. Gosp. Krajowego Rejestru Sądowego
KRS 0000126740, Kapitał zakładowy: 131.200 PLN (opłacony w całości)





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

Re: zip file best practices

Posted by Henryk Konsek <he...@gmail.com>.
> I spent a day or two trying the zip component. Finally got it working,

Yeah, Zip File component need some improvements. It lacks some
functionality and is sometimes a bit unintuitive in a usage.

> but I
> think there is still one thing to cover in this component: recursive reading
> entries from zip package.

We love [1] contributors :) . Our community would highly appreciate
pull request with such enhancement. I personally think that we don't
even need 'recursive' option - we can just automatically detected if
given zip entry is a directory or file.

Cheers.

[1] https://camel.apache.org/contributing.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: zip file best practices

Posted by Jakub Bubin <jb...@datax.pl>.
Hi Guys,

I spent a day or two trying the zip component. Finally got it working, but I
think there is still one thing to cover in this component: recursive reading
entries from zip package.

Use case: I want to unzip .zip file which contains many files and process
them separately. But files in package are not packed directly to the zip,
but somewhere in the directory tree (i.e. files.zip -> directory1 ->
directory2 -> file1.txt, file1.txt and so on..).

I think it should be possible with parameter 'recursive' set to 'true'. At
this moment I think it doesn't work this way.



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

Re: zip file best practices

Posted by JonasF <jo...@fugedi.se>.
Ok, thanks I got it working now! The issue was in my missunderstanding that I needed to unmarshall the zip file into a zipFile before calling the split.



On 24 Jan 2014, at 22:00, alexey-s [via Camel] <ml...@n5.nabble.com> wrote:

> I never used to separate files in zip archive. 
> I use a component splitter to read nested XML files. 
> 
> Example use in spring DSL: 
> http://stackoverflow.com/questions/20294005/using-zipsplitter-in-apache-camel-spring-dsl
> 
> Copy/paste and add comments 
> 
> <bean id="zipSplitter" class="org.apache.camel.dataformat.zipfile.ZipSplitter" />
> ... 
> <split streaming="true" parallelProcessing="true">
>     <ref>zipSplitter</ref>  
>     <!-- Message body is ZipInputStreamWrapper.class extends BufferedInputStream --> 
>     <!-- Header CamelFileName = include_file_name --> 
>     <!-- Header zipFileName = include_file_name --> 
>     <convertBodyTo type="java.lang.String" />
>     <to uri="file:foo" />
> </split>
> 
> 
> 
> 
> Aleksey 
> 
> 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-tp5713437p5746463.html
> To unsubscribe from zip file best practices, click here.
> NAML



SampleZipSplitter.xml (1K) <http://camel.465427.n5.nabble.com/attachment/5746466/0/SampleZipSplitter.xml>




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

Re: zip file best practices

Posted by alexey-s <al...@mail.ru>.
I never used to separate files in zip archive.
I use a component splitter to read nested XML files. 

Example use in spring DSL:
http://stackoverflow.com/questions/20294005/using-zipsplitter-in-apache-camel-spring-dsl

Copy/paste and add comments

<bean id="zipSplitter"
class="org.apache.camel.dataformat.zipfile.ZipSplitter" />
...
<split streaming="true" parallelProcessing="true">
    <ref>zipSplitter</ref> 
    &lt;!-- Message body is ZipInputStreamWrapper.class extends
BufferedInputStream --&gt;
    &lt;!-- Header CamelFileName = include_file_name --&gt;
    &lt;!-- Header zipFileName = include_file_name --&gt;
    <convertBodyTo type="java.lang.String" />
    <to uri="file:foo" />
</split>




Aleksey



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

Re: zip file best practices

Posted by JonasF <jo...@fugedi.se>.
Oh, good! Please provide one working spring XML example! 



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

Re: zip file best practices

Posted by alexey-s <al...@mail.ru>.
ZipSplitter uses the input stream from the archive file (message body). Sends
output stream for each attached file. 
One should not expect from him GenericFile
Nothing complicated.



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

Re: zip file best practices

Posted by JonasF <jo...@fugedi.se>.
I spent a few hours trying to get this to work in Spring DSL as well without
any luck. I tried debugging it and things looked correct but then somehow I
lost the context and the wrong data was coming out (i.e. the ZipSplitter was
called and did its job but the answer got lost somehow). I ran out of
time/patience and implemented a processor which performed the decompression
to a temporary file and passed on each file as a new exchange.

Here is what my xml looked like when it almost worked...

    <bean id="zipSplitter"
class="org.apache.camel.dataformat.zipfile.ZipSplitter"/>

    ...

     <unmarshal><zipFile usingIterator="true"/></unmarshal>
     <split streaming="true">
         <method ref="zipSplitter"/>
         <to uri="direct:csv"/>
      </split>



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

Re: zip file best practices

Posted by peter <pe...@mtsft.com>.
I believe there was an original request on this post for someone to please
show how to use the ZipSplitter with Spring DSL. But I have not seen this
anywhere and I have not been able to get it to work. Here is a snippet of my
attempt:

<bean id="myZipSplitter"
class="org.apache.camel.dataformat.zipfile.ZipSplitter"/>

  <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="file:src/data?noop=true"/>
        <choice>
            <when>
                <simple>${file:name.ext} == 'max'</simple>
                <split streaming="true">
                    <ref>myZipSplitter</ref>
                    <choice>
                        <when>
                            <simple>${header.ZipFileName.ext} ==
'pdz'</simple>
                            <log loggingLevel="TRACE" message="Processing
PDZ: ${header.ZipFileName.ext}"/>
                            <to uri="file:target/data/xml"/>
                        </when>
                        <otherwise>
                            <log message="Ignoring found zip entry :
${header.ZipFileName.ext}"/>
                        </otherwise>
                    </choice>
                </split>
		.
		.
		.
Could someone please post a correct example of usage of the ZipFile
Dataformat (using the ZipSplitter expression) or a statement that it cannot
be used with Spring?



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

Re: zip file best practices

Posted by Willem jiang <wi...@gmail.com>.
Hi Juan,

Thanks for reporting it. I will check out your patch when I get some time next week.  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Saturday, July 6, 2013 at 3:50 AM, Gardella juan wrote:

> Hello Willieem,
>  
> It seems there is a problem with the ZipSplitter that you did. I had added a
> test "ZipProcessRouteBuilderIT" to reproduce the error at
> https://issues.apache.org/jira/browse/CAMEL-6139. If you use my ZipSplitter
> the test works.  
>  
> Thanks,
> Juan
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5735214.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: zip file best practices

Posted by Gardella juan <ga...@gmail.com>.
Hello Willieem,

It seems there is a problem with the ZipSplitter that you did. I had added a
test "ZipProcessRouteBuilderIT" to reproduce the error at
https://issues.apache.org/jira/browse/CAMEL-6139. If you use my ZipSplitter
the test works. 

Thanks,
Juan



--
View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5735214.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 just have a chance to check the code, it is not a new component.
I think we can treat it as an expression, which can help the splitter to
build a Iterator from the uncompressed stream. And it is mainly used with
split DSL.

Willem



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

Re: zip file best practices

Posted by Henryk Konsek <he...@gmail.com>.
Hi guys,

> Puff, sorry. The Jira is https://issues.apache.org/jira/browse/CAMEL-6139

Actually we already got ZipFile component [1], however it supports
only single-entry zip files at the moment.

Instead of creating separated module with zip file splitter I suggest
to add multi-entry zip files support to the
ZipFileDataFormat#unmarshal method, which could just return the
iterator. We would be able to split zip file as follows then...

from("direct:multi-entry-zip-file").unmarshal().zip().split().to("direct:single-zip-entry");

Are there any particular reasons against reusing and improving
existing ZipFile data format?

Best regards.

[1] http://camel.apache.org/zip-dataformat.html

--
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: zip file best practices

Posted by Gardella juan <ga...@gmail.com>.
Puff, sorry. The Jira is https://issues.apache.org/jira/browse/CAMEL-6139



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

Re: zip file best practices

Posted by Gardella juan <ga...@gmail.com>.
Ready at https://issues.apache.org/jira/browse/CAMEL-3468.

Juan



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

Re: zip file best practices

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Mar 4, 2013 at 3:27 PM, Gardella juan
<ga...@gmail.com> wrote:
> Hi,
>
> It is a new feature so I don't touch any existent class of camel. So, in
> what module I have to do a patch?
>

Ah if its new code, then you can attach a .zip to the JIRA ticket with
the source code.

You may want to read this page about developing new components
http://camel.apache.org/add-new-component-guide.html

As we have some points about 3rd party licenses, checkstyle, maven
pom.xml stuff etc


> Juan
>
>
> 2013/3/4 Claus Ibsen-2 [via Camel] <ml-node+s465427n5728457h13@n5.nabble.com
>>
>
>> Hi
>>
>> Thanks for your contribution.
>>
>> Though its easier if its a patch. So I suggest to read here about how
>> to create and submit patches to Apache Camel
>> http://camel.apache.org/contributing.html
>>
>>
>> On Mon, Mar 4, 2013 at 3:05 PM, Gardella juan
>> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5728457&i=0>>
>> wrote:
>>
>> > The source code has a bug. I fixed it and I want to contribute because
>> the
>> > solution is based in alexey-s solution. I 've attached the source code.
>> >
>> > camel-zipsplitter.zip
>> > <http://camel.465427.n5.nabble.com/file/n5728454/camel-zipsplitter.zip>
>> >
>> > Thanks,
>> > Juan
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5728454.html
>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5728457&i=1>
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>
>>
>> ------------------------------
>>  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-tp5713437p5728457.html
>>  To unsubscribe from zip file best practices, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5713437&code=Z2FyZGVsbGFqdWFucGFibG9AZ21haWwuY29tfDU3MTM0Mzd8LTE1MjMxMTI5MDU=>
>> .
>> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5728459.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: zip file best practices

Posted by Gardella juan <ga...@gmail.com>.
Hi,

It is a new feature so I don't touch any existent class of camel. So, in
what module I have to do a patch?

Juan


2013/3/4 Claus Ibsen-2 [via Camel] <ml-node+s465427n5728457h13@n5.nabble.com
>

> Hi
>
> Thanks for your contribution.
>
> Though its easier if its a patch. So I suggest to read here about how
> to create and submit patches to Apache Camel
> http://camel.apache.org/contributing.html
>
>
> On Mon, Mar 4, 2013 at 3:05 PM, Gardella juan
> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5728457&i=0>>
> wrote:
>
> > The source code has a bug. I fixed it and I want to contribute because
> the
> > solution is based in alexey-s solution. I 've attached the source code.
> >
> > camel-zipsplitter.zip
> > <http://camel.465427.n5.nabble.com/file/n5728454/camel-zipsplitter.zip>
> >
> > Thanks,
> > Juan
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5728454.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5728457&i=1>
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>
>
> ------------------------------
>  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-tp5713437p5728457.html
>  To unsubscribe from zip file best practices, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5713437&code=Z2FyZGVsbGFqdWFucGFibG9AZ21haWwuY29tfDU3MTM0Mzd8LTE1MjMxMTI5MDU=>
> .
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




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

Re: zip file best practices

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thanks for your contribution.

Though its easier if its a patch. So I suggest to read here about how
to create and submit patches to Apache Camel
http://camel.apache.org/contributing.html


On Mon, Mar 4, 2013 at 3:05 PM, Gardella juan
<ga...@gmail.com> wrote:
> The source code has a bug. I fixed it and I want to contribute because the
> solution is based in alexey-s solution. I 've attached the source code.
>
> camel-zipsplitter.zip
> <http://camel.465427.n5.nabble.com/file/n5728454/camel-zipsplitter.zip>
>
> Thanks,
> Juan
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5728454.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen