Wiki source code of Temporary Directory

Last modified by Eleni Cojocariu on 2026/04/14 11:24

Show last authors
1 The temporary directory in XWiki is a working folder used to store short-lived data needed during runtime. It is defined by the servlet container through the ##javax.servlet.context.tempdir## property. This property specifies the location of the file system entry that XWiki will use for temporary storage. For XWikii to use this directory, it must have write access to it. Otherwise, XWiki will log warnings or fail to operate correctly, and and attempt to use the [[##java.io.tmpdir##>>https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/System.html#getProperties()]] System property. If this is not a writable directory, an exception will be thrown.
2
3 The temporary directory can be periodically cleaned and all its content deleted, so it must not be used for anything else. What it contains:
4
5 * Cached files (e.g., resized images).
6 * Attachments temporarily extracted from the database.
7 * Other intermediate data generated during processing.
8 * Potentially additional temporary files created by third-party libraries (often also in java.io.tmpdir).
9
10 The temporary directory is used mainly for:
11
12 * Improving performance by caching reusable data (like processed images).
13 * Supporting runtime operations that require temporary storage (e.g., file transformations or attachment handling).

Get Connected