0

I am trying to push a .txt file into existing .tar file but not able to make it. Is it possible through Camel.

bvyas
  • 384
  • 3
  • 10

1 Answers1

0

I don't think is out-of-the-box possible.

If you use TarDataFormat you would have to untar the file first and then tar the individual files with the additional file again.

However, you can try to extend TarAggregationStrategy and adapt it to your need. The Strategy seems to add the content of new messages to an initially created tar file (method addEntryToTar).

In the given implementation this tar file is created on the arrival of the first message. Perhaps you only have to change this initial behaviour.

Perhaps it would even be possible to allow both behaviours (create new tar or use existing) and make this configurable.

See http://camel.apache.org/tar-dataformat.html (paragraph Aggregate how to use the TarAggregationStrategy and have a look at the source of TarAggregationStrategy on GitHub

burki
  • 6,741
  • 1
  • 15
  • 31