Subject: Exported From Confluence
Content-Type: text/html; charset=UTF-8
Jetty itself has no temporary directories, but each web application can =
be assigned a directory into which the war is unpacked, JSPs compiled on-th=
The algorithm for determining a webapp's temporary directory location is=
- Try to use an explicit directory specifically for this webapp:
- Iff webapp.getTempDirectory() is set, use it. Do NOT delete it on=
- Iff javax.servlet.context.tempdir context attribute is set for th=
is webapp && exists && writeable, then use it. Do NOT delet=
e on jvm exit.
- Create a directory based on global settings. The new directory will =
be called "Jetty_"hos=
- Iff $(jetty.home)/work exists create the directory there. Do NOT =
delete on jvm exit. Do NOT delete contents if dir already exists.
- Iff WEB-INF/work exists create the directory there. Do NOT delete=
on jvm exit. Do NOT delete contents if dir already exists.
- Else create dir in $(java.io.tmpdir). Set delete on jvm exit. Del=
ete contents if dir already exists.
It is important to note that a temporary directory will have its content=
s deleted when the webapp is stopped unless either:
- it is called "work"
- it pre-existed the deployment of the webapp
Once a tempory directory has been allocated, a File instance for it is s=
et and retrievable as the
ute of the web application.