Class TemporaryFileManager


  • public final class TemporaryFileManager
    extends java.lang.Object
    Utility class to manage the temporary files that were created when rendering.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.File createTempFile​(java.lang.String prefix, java.lang.String suffix)
      Creates a new temp file.
      static java.io.File getTempDirectory()
      Gets the temp directory used by the temporary file manager.
      static void register​(java.io.File file)
      Registers a new temporary file.
      static void setReady​(java.io.File file)
      The specified file will be added to the set of temporary files that will be deleted when the cleaner is activated.
      static void shutdown()
      Shuts down the manager.
      static void shutdownDeleteAll()
      Shuts down the manager and deletes all registered temporary files.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • register

        public static void register​(java.io.File file)
        Registers a new temporary file.
        Parameters:
        file - the file
      • setReady

        public static void setReady​(java.io.File file)
        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

        public static java.io.File createTempFile​(java.lang.String prefix,
                                                  java.lang.String suffix)
                                           throws java.io.IOException
        Creates a new temp file.
        Parameters:
        prefix - the prefix
        suffix - the suffix
        Returns:
        the file
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • getTempDirectory

        public static java.io.File 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.