I use ICEpdf library for PDF displaying at my desktop java application. Application adds annotations to PDF at runtime, but without changing original files — changes are displayed only during one 'session'. I recently discovered that application creates a lot of temporary files which consume quite a lot of disk space.
Method org.icepdf.core.pobjects.Document.setInputStream has the following code:
// Delete temp file on exit
tempFile.deleteOnExit();
So I suppose it has to remove temporary files after it used them, but it does not:
How can I programmatically remove all files created by application on exit or make standard file removing work?
To get temp folder path:
To remove files:
where regex is filename pattern. In your case: "IcePdf*"