camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: File name changed when Ziping the files in camel
Date Sun, 22 Nov 2015 13:24:21 GMT
Apache Camel is not a zip file tool. What you are doing is not what
Camel was designed for.

You are better of with using perl / bash script or what else is out
there that are much better for these kind of tasks.



On Sun, Nov 22, 2015 at 2:09 PM, Ishada <abhisheksinghbeit@gmail.com> wrote:
> I am trying to implement a scenario which is as follows. Get all the files
> from a location and zip the files and put the zip file to other location. It
> is working fine put when I am trying to open the zip file, camel has changed
> all the files name to default unique naming convention. I want the files
> name not to be modified. I tried in many ways but couldn't achieve it. My
> code looks as follows.
>
> from(from).process(new Processor() {
>                 RouteTerminator terminator;
>                 @Override
>                 public void process(Exchange exchange) throws Exception {
>                     Object data = exchange.getIn().getHeader(
>                             "CamelFileName");
>                     logger.info("File Name for Archive Process" + data);
>                     if (data == null) {
>                         terminator = new RouteTerminator(routeId, exchange
>                                 .getContext());
>                         terminator.start();
>                     }
>                     exchange.getIn().setHeader("CamelFileName", data);
>                 }
>             }).aggregate(new ZipAggregationStrategy()).constant(true)
>             .completionFromBatchConsumer().eagerCheckCompletion()
>             .setHeader(Exchange.FILE_NAME, constant(generateFileName()))
>             .to(to).process(new Processor() {
>                 RouteTerminator terminator;
>
>                 @Override
>                 public void process(Exchange exchange) throws Exception {
>                     log.debug("RouteTerminator is called from
> ServerArchiveFilesRoute to Stop the route");
>                     terminator = new RouteTerminator(routeId, exchange
>                             .getContext());
>                     terminator.start();
>
>                 }
>             }).routeId(routeId);
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/File-name-changed-when-Ziping-the-files-in-camel-tp5774234.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message