Class TemporaryFileManager

java.lang.Object
com.saperion.connector.renditions.util.TemporaryFileManager

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

    • register

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

      public static void setReady(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 File createTempFile(String prefix, String suffix) throws IOException
      Creates a new temp file.
      Parameters:
      prefix - the prefix
      suffix - the suffix
      Returns:
      the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getTempDirectory

      public static 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.