I was rooting around on my Mac as I had just installed a new SSD and I wanted to do a clean install of a lot of stuff. I noticed a bunch of pdfs hanging around and I wanted to find out where they were coming from.
I found them here:
/var/folders/f1/68bl839n5vzcw6l75jgykqk40000gn/T
These pdfs are create whenever I run my app and create a pdf with ERJasperReports. They get created in ERJRUtilities.java in the method runCompiledReportToPDFFile it looks like:
File destFile = File.createTempFile(compiledReportName + System.currentTimeMillis(), ".pdf");
I am reading everything in Kieran’s ERJasperReports, I don’t see that the temp files are ever deleted. Did I miss something obvious? After googling around, I found a few conversations on StackOverflow all talk about temp files and methods to make sure they are deleted.
of course I could add destFile.deleteOnExit(); before returning, but that just means the temp file will get deleted when the app exits. Or rather it gets deleted when the VM terminates normally.
Is anyone else using ERJasperReports that can confirm that these temp files are or are not being deleted?
this is the stack overflow conversation. It appears to be rather complex as the destFile is created, but needs to hang around until it has been properly downloaded.
Does anyone have any experience with JasperReports either your own creation, or using ERJasperReports that takes care of these pesky temp files?