I have a issue with camel apache. My csv file has LF and CRLF in it. The LF is present in the values of my csv file. When camel gets my file from the ftp and put it on my desktop, the LF is no more there. But i need the LF character to format correctly my csv and cosume it with the bindy component.
from("timer://products?fixedRate=true&period="+ TimeUnit.SECONDS.toMillis(30))
.pollEnrich()
.simple("ftp://"+ftpUsername+"@"+ftpServer+"?password="+ftpPassword+"&passiveMode=true&stepwise=true&delay=1000&delete=true&include=.*sensopur_product\\.csv$")
.process(exchange -> {
System.out.println(exchange.getIn().getBody());
String value = exchange.getIn().getHeader("CamelFileName").toString();
if (value != null && !value.equals("")){
exchange.getIn().setHeader("nomFichier",value);
}else {
exchange.getIn().setHeader("nomFichier","pas de fichier");
}
exchange.getIn().setBody(exchange.getIn().getBody(String.class));
})
.setHeader("nomFichier", simple("${in.header.CamelFileName}"))
.to("file://../sensopur/src/main/resources/static")
.end();
How can i do to keep the LF when camel apache gets my file on the FTP server ? Thanks.