Class DefaultTempFileCreationStrategy

  • All Implemented Interfaces:
    TempFileCreationStrategy
    Direct Known Subclasses:
    UserNameAwareTempFileCreationStrategy

    public class DefaultTempFileCreationStrategy
    extends Object
    implements TempFileCreationStrategy
    Default implementation of the TempFileCreationStrategy used by TempFile: Files are collected into one directory. Files may be manually deleted by user prior to JVM exit. You can define the system property DELETE_FILES_ON_EXIT if you want to delete any stray files on clean JVM exit (any non-empty value means add the deleteOnExit flag). The POI code should tidy up temp files when it no longer needs them. The temporary directory is not deleted after the JVM exits. Files that are created in the poifiles directory outside the control of DefaultTempFileCreationStrategy are not deleted. See TempFileCreationStrategy for better strategies for long-running processes or limited temporary storage.
    • Field Detail

      • DELETE_FILES_ON_EXIT

        public static final String DELETE_FILES_ON_EXIT
        To use files.deleteOnExit after clean JVM exit, set the -Dpoi.delete.tmp.files.on.exit JVM property
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultTempFileCreationStrategy

        public DefaultTempFileCreationStrategy()
        Creates the strategy so that it creates the temporary files in the default directory.
        See Also:
        File.createTempFile(String, String)