Package dev.prozilla.pine.common.system
Class FileSystem
java.lang.Object
dev.prozilla.pine.common.system.FileSystem
Utility class for manipulating files and directories.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyDirectory(File source, File target) Helper method for copying a directory and its contents recursively.static voiddeleteDirectory(Path directory) Helper method for deleting non-empty directories.static voidDownloads a URL into a target directory.static PathgetSubdirectory(Path directory) static voidunwrapDirectory(Path directory) Moves the contents of a directory one level up and deletes the directory.static voidUnzips a zip file into a target directory and deletes it.
-
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:
URISyntaxExceptionIOException
-
unzip
Unzips a zip file into a target directory and deletes it.- Throws:
IOException
-