I'm developing a tomcat webapp. When run, my webapp generates data files that I'd like to be persistent between tomcat restarts, or at least I'd like to control when they're deleted. Both workDir (i.e., javax.servlet.context.tempdir
) and the java temp dir (i.e. java.io.tmpdir
) are implied to be temporary. Is there some other directory I could use?
Asked
Active
Viewed 207 times
0

amos
- 5,092
- 4
- 34
- 43
-
This is a closely related question: http://stackoverflow.com/questions/8853387/clarifications-on-tomcats-temp-and-work-directories – amos Feb 14 '14 at 00:52
1 Answers
3
You can use any directory you want. Just make sure that it is writable by the user running the Tomcat process. If you want to have control over when it is cleaned, then it is not strictly speaking a "temp" directory, it is just a directory.

David Levesque
- 22,181
- 8
- 67
- 82