[
https://issues.apache.org/jira/browse/CAMEL-10853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15872218#comment-15872218
]
ASF GitHub Bot commented on CAMEL-10853:
----------------------------------------
GitHub user ribeaud opened a pull request:
https://github.com/apache/camel/pull/1474
[CAMEL-10853] Add support for some more properties
OK, now it looks better...
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ribeaud/camel feature/CAMEL-10853
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1474.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1474
----
commit 2d425d3545399148421ada31abc50fbc082e64ba
Author: Christian Ribeaud <[email protected]>
Date: 2017-02-17T17:55:18Z
[CAMEL-10853] Add support for some more properties
----
> CsvDataFormat should be completed with 'CSVFormat.withTrim'
> -----------------------------------------------------------
>
> Key: CAMEL-10853
> URL: https://issues.apache.org/jira/browse/CAMEL-10853
> Project: Camel
> Issue Type: Improvement
> Components: camel-csv
> Affects Versions: 2.18.1
> Reporter: Christian Ribeaud
> Priority: Minor
>
> In *Camel* {{org.apache.commons.csv.CSVFormat}} is indirectly configured via
> {{org.apache.camel.model.dataformat.CsvDataFormat}}. Although it is possible
> to tell {{CSVFormat}} to trim leading and trailing blanks via
> {{CSVFormat.withTrim}}, this property can NOT be set in {{CsvDataFormat}}.
> h4. Workaround
> As a workaround, one could do the following:
> {code:java}
> CsvDataFormat dataFormat = new CsvDataFormat("\t") {
> @Override
> protected void configureDataFormat(DataFormat dataFormat,
> CamelContext camelContext) {
> // This is how we force the engine to trim the values
> org.apache.camel.dataformat.csv.CsvDataFormat csvDataFormat =
> (org.apache.camel.dataformat.csv.CsvDataFormat) dataFormat;
> CSVFormat format = csvDataFormat.getFormat();
> csvDataFormat.setFormat(format.withTrim());
> super.configureDataFormat(csvDataFormat, camelContext);
> }
> };
> {code}
> h4. Question
> Are they other properties which should be considered?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)