Class TempFile

java.lang.Object
org.pgcodekeeper.core.utils.TempFile
All Implemented Interfaces:
AutoCloseable

public final class TempFile extends Object implements AutoCloseable
Wrapper for creation and automatic deletion of a temporary file. Intended for try-with-resources usage to ensure proper cleanup. Automatically deletes the file when closed.
Author:
Alexander Levsha
  • Constructor Details

    • TempFile

      public TempFile(Path dir, String prefix, String suffix) throws IOException
      Creates a temporary file with specified prefix and suffix in the given directory.
      Parameters:
      dir - the directory to create file in
      prefix - the file name prefix
      suffix - the file name suffix
      Throws:
      IOException - if file creation fails
  • Method Details