Class DirectoryUtil

java.lang.Object
com.bluebell.greenhouse.platform.util.file.DirectoryUtil

public final class DirectoryUtil extends Object
Utility class for file and directory operations.
Version:
1.0.5
Author:
Stephen Prizio
  • Method Details

    • getOutputDirectory

      public static String getOutputDirectory()
      Returns the output directory.
      Returns:
      output directory path
    • getTargetDirectory

      public static String getTargetDirectory(String root, boolean create)
      Returns the root folder for the given folder name.
      Parameters:
      root - data create
      create - if true, create directory
      Returns:
      sample data path
    • getBaseProjectDirectory

      public static String getBaseProjectDirectory()
      Returns a path to the base project directory.
      Returns:
      file path to base project directory
    • getTestingResourcesDirectory

      public static String getTestingResourcesDirectory()
      Returns the path to the base project's testing resources.
      Returns:
      file path to the base project's testing resources
    • getTempDirectory

      public static File getTempDirectory() throws IOException
      Creates a temporary directory.
      Returns:
      File
      Throws:
      IOException - io exception
    • deleteTempDirectory

      public static void deleteTempDirectory(File directory)
      Removes a directory created by getTempDirectory() 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