Package dev.prozilla.pine.common.system
Class FileSystem
java.lang.Object
dev.prozilla.pine.common.system.FileSystem
Utility class for manipulating files and directories.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyDirectory
(File source, File target) Helper method for copying a directory and its contents recursively.static void
deleteDirectory
(Path directory) Helper method for deleting non-empty directories.static void
Downloads a URL into a target directory.static Path
getSubdirectory
(Path directory) static void
unwrapDirectory
(Path directory) Moves the contents of a directory one level up and deletes the directory.static void
Unzips a zip file into a target directory and deletes it.
-
Constructor Details
-
FileSystem
public FileSystem()
-
-
Method Details
-
deleteDirectory
Helper method for deleting non-empty directories. -
copyDirectory
Helper method for copying a directory and its contents recursively.- Throws:
IOException
-
getSubdirectory
- Throws:
IOException
-
unwrapDirectory
Moves the contents of a directory one level up and deletes the directory.- Throws:
IOException
-
download
Downloads a URL into a target directory.- Throws:
URISyntaxException
IOException
-
unzip
Unzips a zip file into a target directory and deletes it.- Throws:
IOException
-