suryakantmandal Posted August 7, 2018 Share Posted August 7, 2018 I am using JRFileVirtualizer to prepare the report but its creating thousands of temp files virt**** which is creating disc full problem on server.I have called virtualizer.cleanup(); to clean the files created post the report has generated but this also not delteing the temp files.Is there any way to get the names of temp files created so that I can ran manual cleanup matching those name before ending the process.if(outputType.equals(OutputTypeEnum.EXCEL)) { JasperFillManager jasperFillManager = JasperFillManager.getInstance(DefaultJasperReportsContext.getInstance()); JasperPrint jasperPrint = jasperFillManager.fill(reportStream, parameterMap, connection); JRXlsExporter exporter = new JRXlsExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outputFilename); exporter.exportReport(); result.setReportContent(FileUtils.readFileToByteArray(new File(outputFilename))); result.setOutputFile(new File(outputFilename)); }====JRFileVirtualizer virtualizer = new JRFileVirtualizer(VIRTUAL_PAGE_SIZE, makeTempDirectory()); parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer); Thanks,Surya Link to comment Share on other sites More sharing options...
hozawa Posted August 7, 2018 Share Posted August 7, 2018 Instead, how about specifying the location of the temporary file directory in the jvm with "-Djava.io.tmpdir" option and the deleting every file in that directory? Link to comment Share on other sites More sharing options...
suryakantmandal Posted August 8, 2018 Author Share Posted August 8, 2018 @howza If multiple repors are running simultaneously then cleaning the entire directory will delete the virtual files of another report which may be still in progress. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now