I need to do the following routine:
I was able to do items 1 and 2, generating the file as follows:
FileWriter writer = new FileWriter("c:\test.csv");
writer.append("user");
writer.flush();
writer.close();
Going to item 3. Define the field in the database as BLOB and in the entity as byte[];
How do I convert the object FileWriter
to byte?
Regarding item 4, I intend to use p:fileDownload
of Primefaces. However it expects a StreamedContent
, that is. I'll have to do a new conversion!
I may be wrong in some of these notes. And I ask everyone's help to solve this problem!