Reputation: 1128
I found out that when I call:
File.createTempFile();
in tomcat7 my temp file is created. BUT... it is deleted immediately after the Thread creating this file ends.
The default behavior of JVM should be to keep these files until it is shutdown. Apparently tomcat overwrites this behavior. Is there any switch to change this so that tomcat would keep the temp file?
Upvotes: 2
Views: 683
Reputation: 1069
File.createTempFile("filename","format");
will create a file with scope for that particular thread only.
May be manually calling like
File.deleteOnExit()
might help.
Upvotes: 2