On Sat, Oct 3, 2009 at 12:29 AM, Vladimir Okhotnikov
<[email protected]> wrote:
>
> Hi
>
> first of all, thanks for the great framework. The learning curve is a bit,
> steep, but the possibilities are surely worth it.
>
> Apparently I have a small problem with a ZIP data format. In my project, I
> have to download zipped files from FTP, uncompress and process them. So, I
> guess the route should be like:
>  from("ftp://...";).unmarshal().zip().to(...)
> While writing a test for that particular route, I've created a small test
> zip file and tried to process it - with no luck - all I got was the
> ZipException "unknown compression method"
>
> I also tried feeding the actual zip file from the FTP, with the same result.
>
> Eventually I looked at the code, and found that zip data format processing
> is being done by org.apache.camel.impl.ZipDataFormat class. What's strange
> is that the class uses java.zip.InflaterOutputStream (and its
> DeflaterOutputStream counterpart). Now, by no means I'm an expert in
> compression methods, but the java API docs claims that those classes use
> "deflate" method, not "zip". For "zip" method I think ZipInputStream must be
> used instead?
>

Yeah the person who submitted this data format wrote it in that way
and it was branded zip from the start.
Its meant for e.g. text/xml payloads to be compressed / decompressed
for example over http.

You are welcome to take a look if you can enhance it and offer an
option to select which "mode" to use.

BTW: We had a though of adding Commons VFS for zip file handling. But
the person who started the work on it never really took off.


> As a side note, can anyone give me an advice whether it is possible to add a
> custom data format without modifying/recompiling camel code?
>
> Regards,
> Vladimir Okhotnikov
> --
> View this message in context: 
> http://www.nabble.com/Zip-format-problem-tp25723682p25723682.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to