Class PathHelper
java.lang.Object
com.marginallyclever.convenience.helpers.PathHelper
Utility functions for working with the local file system.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
addExtensionIfNeeded
(String filename, String[] extensions) Check filename for a valid extension.static void
static void
deleteDirectory
(File directory) Dangerous - recursively deletes directory and all contents!static String
static String
getExtension
(String path) Get the file extension from a path.static void
static void
static void
start()
-
Field Details
-
APP_BASE
-
APP_CACHE
-
APP_PLUGINS
-
SCENE_PATH
-
-
Constructor Details
-
PathHelper
public PathHelper()
-
-
Method Details
-
getExtension
Get the file extension from a path.- Parameters:
path
- The path to get the extension from.- Returns:
- The extension of the path.
-
addExtensionIfNeeded
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
-
setCurrentWorkingDirectory
-
start
public static void start() -
goToAppWorkingDirectory
public static void goToAppWorkingDirectory() -
createDirectoryIfNotExists
-
deleteDirectory
Dangerous - recursively deletes directory and all contents!- Parameters:
directory
- The directory to delete.
-