Class TempDirectoryUtil

java.lang.Object
com.atlassian.jira.util.TempDirectoryUtil

public class TempDirectoryUtil extends Object
This util class was added to be able to create a "temporary" directory.
Since:
v3.13
  • Constructor Details

    • TempDirectoryUtil

      public TempDirectoryUtil()
  • Method Details

    • createTempDirectory

      public static File createTempDirectory(String prefix)
      Creates an empty directory in the default temporary-file directory, using the given prefix and suffix to generate its name.

      Note: these directories will get deleted when the JVM exits.

      Parameters:
      prefix - The prefix string to be used in generating the directory's name.
      Returns:
      A File object denoting a newly-created empty directory
    • getSystemTempDir

      public static String getSystemTempDir()
      Returns the system's temp directory.

      Be aware that some operating systems place a trailing slash and others don't.

      Returns:
      the system's temp directory.