07-03-2019 02:30 AM
Hi everyone,
I want to read 50-100 MB CSV file in java script rule to update the details in Alfresco data list. But I am getting Java Heap space issue on the below line of code.
var items = companyhome.childByNamePath("/Sites/datalists/documentLibrary/Demo.csv").content;
How can I solve this issue?
Thanks,
Yash
07-03-2019 08:47 AM
Hi,
ContentReader cr = fileFolderService.getReader(new NodeRef("noderef"));
InputStream fis = cr.getContentInputStream();Scanner sc = new Scanner(fis, "UTF-8");
while (sc.hasNextLine()) {
String line = sc.nextLine();
System.out.println(line);
}
With above code 55 MB file reading fine.Without any error.
Explore our Alfresco products with the links below. Use labels to filter content by product module.