Class TemporaryFileManager
java.lang.Object
com.saperion.connector.renditions.util.TemporaryFileManager
Utility class to manage the temporary files that were created when rendering.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FilecreateTempFile(String prefix, String suffix) Creates a new temp file.static FileGets the temp directory used by the temporary file manager.static voidRegisters a new temporary file.static voidThe specified file will be added to the set of temporary files that will be deleted when the cleaner is activated.static voidshutdown()Shuts down the manager.static voidShuts down the manager and deletes all registered temporary files.
-
Method Details
-
register
Registers a new temporary file.- Parameters:
file- the file
-
setReady
The specified file will be added to the set of temporary files that will be deleted when the cleaner is activated.- Parameters:
file- the file
-
createTempFile
Creates a new temp file.- Parameters:
prefix- the prefixsuffix- the suffix- Returns:
- the file
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getTempDirectory
Gets the temp directory used by the temporary file manager.- Returns:
- the temp directory
-
shutdown
public static void shutdown()Shuts down the manager. -
shutdownDeleteAll
public static void shutdownDeleteAll()Shuts down the manager and deletes all registered temporary files.
-