Package org.spongepowered.asm.util
Class Files
java.lang.Object
org.spongepowered.asm.util.Files
Utility class for file operations
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeleteRecursively(File dir) Recursively delete a directory.static FileConvert a URI to a file but handle a corner case with UNC paths which do not parse correctly.static FileConvert a URL to a file but handle a corner case with UNC paths which do not parse correctly.
-
Method Details
-
toFile
Convert a URL to a file but handle a corner case with UNC paths which do not parse correctly.- Parameters:
url- URL to convert- Returns:
- File
- Throws:
URISyntaxException- if the URL cannot be converted to a URI
-
toFile
Convert a URI to a file but handle a corner case with UNC paths which do not parse correctly.- Parameters:
uri- URI to convert- Returns:
- File
-
deleteRecursively
Recursively delete a directory. Does not support symlinks but this is mainly used by mixin internals which only write files and normal directories so it should be fine- Parameters:
dir- Root directory to delete- Throws:
IOException- Security errors and any other IO errors encountered are raised as IOExceptions
-