java.lang.Object
com.marginallyclever.convenience.helpers.PathHelper

public class PathHelper extends Object
Utility functions for working with the local file system.
  • Field Details

    • APP_BASE

      public static final String APP_BASE
    • APP_CACHE

      public static final String APP_CACHE
    • APP_PLUGINS

      public static final String APP_PLUGINS
    • SCENE_PATH

      public static final String SCENE_PATH
  • Constructor Details

    • PathHelper

      public PathHelper()
  • Method Details

    • getExtension

      public static String getExtension(String path)
      Get the file extension from a path.
      Parameters:
      path - The path to get the extension from.
      Returns:
      The extension of the path.
    • addExtensionIfNeeded

      public static String addExtensionIfNeeded(String filename, String[] extensions)
      Check filename for a valid extension. If it doesn't have one, add the first extension in the list.
      Parameters:
      filename - The filename to check.
      extensions - A list of valid extensions.
      Returns:
      The filename with a valid extension.
    • getCurrentWorkingDirectory

      public static String getCurrentWorkingDirectory()
    • setCurrentWorkingDirectory

      public static void setCurrentWorkingDirectory(String dir)
    • start

      public static void start()
    • goToAppWorkingDirectory

      public static void goToAppWorkingDirectory()
    • createDirectoryIfNotExists

      public static void createDirectoryIfNotExists(String path)
    • deleteDirectory

      public static void deleteDirectory(File directory)
      Dangerous - recursively deletes directory and all contents!
      Parameters:
      directory - The directory to delete.