Package org.docx4j.org.apache.poi.util
Class TempFile.DefaultTempFileCreationStrategy
java.lang.Object
org.docx4j.org.apache.poi.util.TempFile.DefaultTempFileCreationStrategy
- All Implemented Interfaces:
TempFileCreationStrategy
- Enclosing class:
- TempFile
public static class TempFile.DefaultTempFileCreationStrategy
extends Object
implements TempFileCreationStrategy
Default implementation of the
TempFileCreationStrategy used by TempFile:
Files are collected into one directory and by default are deleted on exit from the VM.
Files can be kept by defining the system property poi.keep.tmp.files.-
Constructor Summary
ConstructorsConstructorDescriptionCreates the strategy so that it creates the temporary files in the default directory.Creates the strategy allowing to set the -
Method Summary
Modifier and TypeMethodDescriptioncreateTempFile(String prefix, String suffix) Creates a new and empty temporary file.
-
Constructor Details
-
DefaultTempFileCreationStrategy
public DefaultTempFileCreationStrategy()Creates the strategy so that it creates the temporary files in the default directory.- See Also:
-
DefaultTempFileCreationStrategy
Creates the strategy allowing to set the- Parameters:
dir- The directory where the temporary files will be created (nullto use the default directory).- See Also:
-
-
Method Details
-
createTempFile
Description copied from interface:TempFileCreationStrategyCreates a new and empty temporary file.- Specified by:
createTempFilein interfaceTempFileCreationStrategy- Parameters:
prefix- The prefix to be used to generate the name of the temporary file.suffix- The suffix to be used to generate the name of the temporary file.- Returns:
- The path to the newly created and empty temporary file.
- Throws:
IOException- If no temporary file could be created.
-