Package com.atlassian.jira.util
Interface FileFactory
- All Known Implementing Classes:
FileSystemFileFactory
public interface FileFactory
Interface for file operations. This interface exists so that we can mock out IO operations in unit tests.
- Since:
- v4.3
-
Method Summary
Modifier and TypeMethodDescriptionCreates a File object for the file with the given path.void
removeDirectory
(File directory) Removes a directory.void
removeDirectoryIfExists
(String directoryName) Removes a directory if it exists.
-
Method Details
-
getFile
Creates a File object for the file with the given path.- Parameters:
absoluteFilename
- a String containing an absolute path name- Returns:
- a new File
-
removeDirectory
Removes a directory.- Parameters:
directory
- a File object
-
removeDirectoryIfExists
Removes a directory if it exists.- Parameters:
directoryName
- a String containing a directory path
-