Creates a temporary file. Files are collected into one directory and by default are
deleted on exit from the VM. Files can be kept by defining the system property
poi.keep.tmp.files
.
Dont forget to close all files or it might not be possible to delete them.
if (dir == null)
{
dir = new File(System.getProperty("java.io.tmpdir"), "poifiles");
dir.mkdir();
if (System.getProperty("poi.keep.tmp.files") == null)
dir.deleteOnExit();
}
File newFile = new File(dir, prefix + rnd.nextInt() + suffix);
if (System.getProperty("poi.keep.tmp.files") == null)
newFile.deleteOnExit();
return newFile;