Package org.verifyica.api
Class TemporaryDirectory
java.lang.Object
org.verifyica.api.TemporaryDirectory
- All Implemented Interfaces:
AutoCloseable
Class to implement TemporaryDirectory
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddelete()Method to delete the temporary directorybooleaninthashCode()static TemporaryDirectoryMethod to create a new temporary directory with default permissionsstatic TemporaryDirectorynewDirectory(Set<PosixFilePermission> posixFilePermissions) Method to create a new temporary directory with specified POSIX file permissionsnewFile()Method to create a new file in the temporary directory, using the permissions set for the temporary directorynewFile(Set<PosixFilePermission> posixFilePermissions) Method to create a new file in the temporary directory with specified permissionstoFile()Get the temporary directory FiletoPath()Get the temporary directory PathtoString()
-
Method Details
-
toFile
Get the temporary directory File- Returns:
- the temporary directory File
-
toPath
Get the temporary directory Path- Returns:
- the temporary directory Path
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
delete
Method to delete the temporary directory- Throws:
IOException- IOException
-
newFile
Method to create a new file in the temporary directory, using the permissions set for the temporary directory- Returns:
- the new file
- Throws:
IOException- IOException
-
newFile
Method to create a new file in the temporary directory with specified permissions- Parameters:
posixFilePermissions- the permissions to set for the new file- Returns:
- the new file
- Throws:
IOException- If an I/O error occurs
-
toString
-
equals
-
hashCode
public int hashCode() -
newDirectory
Method to create a new temporary directory with default permissions- Returns:
- a new TemporaryDirectory
- Throws:
IOException- If an I/O error occurs
-
newDirectory
public static TemporaryDirectory newDirectory(Set<PosixFilePermission> posixFilePermissions) throws IOException Method to create a new temporary directory with specified POSIX file permissions- Parameters:
posixFilePermissions- the POSIX file permissions to set for the temporary directory- Returns:
- a new TemporaryDirectory
- Throws:
IOException- If an I/O error occurs
-