Hi

Yeah write your own java class / method that appends to the start of the file.

There is no such functionality out of the box, as fileExists=Append
appends at the end

On Tue, Apr 4, 2017 at 1:12 PM, Amruta Jawlekar <[email protected]> wrote:
> Hi All,
>
> I need to append text like XML Header tag in the beginning of a file.
> I know one way to achieve it -
> 1. Create a String/StringBuilder/List<String> having header tag.
> 2. Unmarshal the file contents and convert inputstream to List/String or any
> suitable object
> 3. Append the existing contents to the header tag String/List
> 4. Write contents to same file.
>
> But I feel that the 2nd step is unnecessary. I just need to append the XML
> tag to the start of file, regardless of what contents the File already has.
>
> Please let me know if Camel supports this? setting FileExists = Append
> always appends the text at the end of file, I need it in the beginning.
>
> OR
>
> is it better that I directly use the Java File API to do the same instead of
> above mentioned steps.
>
> Any pointers would be helpful.
> Thanks.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-append-text-to-the-beginning-of-the-file-using-Camel-tp5796906.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

Reply via email to