How to create a temporary file?
A temporary file can be created by using
java.io.File.createTempFile() method. It accepts the prefix, suffix and the path where the file will be stored. When no path is specified it will use the platform default temporary folder.
The name of the temporary file will be in the form of prefix plus five or more random characters plus the suffix. When the suffix is
null a default
.tmp will be used for suffix.