Class TemporaryDirectory

java.lang.Object
org.verifyica.api.TemporaryDirectory
All Implemented Interfaces:
AutoCloseable

public class TemporaryDirectory extends Object implements AutoCloseable
Class to implement TemporaryDirectory
  • Constructor Details

    • TemporaryDirectory

      public TemporaryDirectory() throws IOException
      Constructor
      Throws:
      IOException - IOException if the temporary directory can't be created
    • TemporaryDirectory

      public TemporaryDirectory(TemporaryDirectory.CleanupMode cleanupMode) throws IOException
      Constructor
      Parameters:
      cleanupMode - cleanupMode
      Throws:
      IOException - IOException if the temporary directory can't be created
    • TemporaryDirectory

      public TemporaryDirectory(String prefix) throws IOException
      Constructor
      Parameters:
      prefix - prefix
      Throws:
      IOException - IOException if the temporary directory can't be created
    • TemporaryDirectory

      public TemporaryDirectory(String prefix, TemporaryDirectory.CleanupMode cleanupMode) throws IOException
      Constructor
      Parameters:
      prefix - prefix
      cleanupMode - cleanupMode
      Throws:
      IOException - IOException if the temporary directory can't be created
  • Method Details

    • file

      public File file()
      Get the temporary directory File
      Returns:
      the temporary directory File
    • toFile

      public File toFile()
      Get the temporary directory File
      Returns:
      the temporary directory File
    • path

      public Path path()
      Get the temporary directory Path
      Returns:
      the temporary directory Path
    • toPath

      public Path toPath()
      Get the temporary directory Path
      Returns:
      the temporary directory Path
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • delete

      public void delete() throws IOException
      Method to delete the temporary directory
      Throws:
      IOException - IOException
    • newFile

      public File newFile() throws IOException
      Method to create a new file in the temporary directory
      Returns:
      the new file
      Throws:
      IOException - IOException
    • newFile

      public File newFile(String name) throws IOException
      Method to create a new file in the temporary directory
      Parameters:
      name - name
      Returns:
      the new file
      Throws:
      IOException - IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object