Class SessionTempFiles
java.lang.Object
vaadinx.SessionTempFiles
Per-
VaadinSession scratch space for files that cross the browser
boundary — the upload-to-temp-File (LOAD) and File-to-download (SAVE) staging
that vaadinx.awt.FileDialog and vaadinx.swing.JFileChooser
use to bridge the java.io.File semantic gap.
A browser-side Upload has no real file the server can see, so its
bytes are written into a session-private temp directory and handed back to
migrated code as an ordinary java.io.File (so new
FileInputStream(f) / f.length() / f.getName() work
unchanged). The whole directory tree is recursively deleted when the session
is destroyed, so temp files don't outlive the user — registered lazily and
exactly once per session via a self-removing SessionDestroyListener.
Work in progress alongside FileDialog / JFileChooser
— see those classes' headers for the slice's status ledger.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PathA fresh empty sub-directory undersessionDir()for one file-dialog show — either direction: LOAD stages uploaded bytes here, SAVE points the app's write target here.static PathThe session-private temp root, created and registered for cleanup on first use.
-
Method Details
-
sessionDir
The session-private temp root, created and registered for cleanup on first use. ThrowsIllegalStateExceptionif there is no current session — file staging only happens on a UI/request thread. -
newTransferDir
A fresh empty sub-directory undersessionDir()for one file-dialog show — either direction: LOAD stages uploaded bytes here, SAVE points the app's write target here. Per-show isolation keeps a later dialog from clobbering temp files an earlier one handed to the app (which may still hold theFilereference / download link).
-