In my web application I am creating a file that eventually the user will download.
This file should be stored in the memory until the user will download it.
So I am using File.createTempFile() for this task.
Is it a good approach or maybe there is a better why for creating files ?
Thanks
I find it a good approach but you must know that creating temp files actually means that the file is created on the disk, not in memroy.
Also deleting it when the VM terminates may be another good step.