Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 81216

How do I write to a file Line by Line in a Mendix Java Action

$
0
0

 I have a large file that needs to be created.

The sum of all the data in the file means that extracting all the data in one go holding it in memory then creating the output stream of all data is not practical, as the server has a memory overload.

My solution is to process the rows of data to be written to the file one at a time.

The following code will write the whole of the data to the file in one go:

Core.storeFileDocumentContent(getContext(), processFile.getMendixObject(), this.fileName,
new ByteArrayInputStream(exportFile.getBytes()));

I can write to a file one row at a time using Java, but how do I associate the file with the Mendix object (which inherits System.FileDocument  )


Viewing all articles
Browse latest Browse all 81216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>