Thursday, 19 September 2013

getting newlines right when posting file to grails app

getting newlines right when posting file to grails app

I have to make a massive import to a data base. Lets say around 100k rows.
The user has to be able to handle the file with the rows, like a csv. With
one data per line.
As in the company I have to use rest apis for every thing I want to make
an api in grails that you can post a file into and the api handle the
import job.
So making something like
curl -X POST -d @file http://apiurl/process-file
I'm trying to achieve this in grails.
First I had to add filters in order to get more than one inputstream from
the request, in orther to get the raw content of the file.
The problem that I have now is that it doesn't recognize the newlines in
the file.
I put an app here that reproduce the case.
I wan't to know what's the problem and how to achieve this the simplest
way possible.
I would thank any advice or pointer.

No comments:

Post a Comment