Class TempResourceCreator

java.lang.Object
io.github.dornol.excelkit.core.TempResourceCreator

public class TempResourceCreator extends Object
Utility class for creating temporary files and directories with appropriate permissions.
Since:
2025-07-19
  • Method Details

    • createTempDirectory

      public static Path createTempDirectory()
      Creates a new temporary directory.

      On POSIX-compliant file systems, the directory is created with restricted (rwx------) permissions. On Windows (ACL-based), the directory's ACL is restricted to the current user only.

      Returns:
      Path to the created temporary directory
      Throws:
      TempResourceCreateException - If directory creation fails
    • createTempFile

      public static Path createTempFile(Path directory, String prefix, String suffix)
      Creates a new temporary file in the specified directory.
      Parameters:
      directory - The parent directory
      prefix - The file prefix
      suffix - The file suffix (extension)
      Returns:
      Path to the created temporary file
      Throws:
      TempResourceCreateException - If file creation fails