title: Apache Camel - Exporting data in JSON format in one (too) big line
body: <p>I am exporting data (Java DTO's) into text files with JSON format using following route section at the end:</p>
  
  <pre><code>    JsonDataFormat jsonDataFormat = new JsonDataFormat(JsonLibrary.Gson);
      jsonDataFormat.setPrettyPrint(Boolean.TRUE);
  
      // ...
  
      .setProperty(Exchange.CHARSET_NAME, constant(UTF))
      .marshal(jsonDataFormat) //.json(JsonLibrary.Gson)
      .convertBodyTo(String.class, UTF) // 2. change to "UTF" encoding
      .convertBodyTo(byte[].class, UTF) // 3. convert string to byte
      .to("file:/?charset=utf-8")//
  </code></pre>
  
  <p>Since there is a lot of data, the output is big.
  That is not a problem. The problem is that it is all written in one long line.</p>
  
  <p>To test the data I have to open those files. I like to use Notepad++, since with that editor I can format it using the "JSON Viewer" plugin.</p>
  
  <p>When these files are bigger than a certain size (around 100 KB or 100 millions characters), it is not possible to open the file with Notepad++.
  But not only that. The handling of the files is difficult because of that long line.</p>
  
  <p>Therefore I am looking for a method to insert some "carriage return" using "pretty print". 
  The code above do not work. Any idea why? Or any other way to reach that without using other libraries?</p>
  
  <p>camel-version>2.14.0
  gson-version>2.2.2</p>