Class DirectoryUtil
java.lang.Object
com.bluebell.greenhouse.platform.util.file.DirectoryUtil
Utility class for file and directory operations.
- Version:
- 1.0.5
- Author:
- Stephen Prizio
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeleteTempDirectory(File directory) Removes a directory created bygetTempDirectory()and anything still inside it.static StringReturns a path to the base project directory.static StringReturns the output directory.static StringgetTargetDirectory(String root, boolean create) Returns the root folder for the given folder name.static FileCreates a temporary directory.static StringReturns the path to the base project's testing resources.
-
Method Details
-
getOutputDirectory
Returns the output directory.- Returns:
- output directory path
-
getTargetDirectory
-
getBaseProjectDirectory
Returns a path to the base project directory.- Returns:
- file path to base project directory
-
getTestingResourcesDirectory
Returns the path to the base project's testing resources.- Returns:
- file path to the base project's testing resources
-
getTempDirectory
Creates a temporary directory.- Returns:
File- Throws:
IOException- io exception
-
deleteTempDirectory
Removes a directory created bygetTempDirectory()and anything still inside it. Failing to clean up is reported rather than thrown, since it never changes the outcome of the work the directory was created for.- Parameters:
directory- directory to remove, may be null or already gone
-