Package org.spongepowered.asm.util
Class Files
- java.lang.Object
-
- org.spongepowered.asm.util.Files
-
public final class Files extends java.lang.ObjectUtility class for file operations
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeleteRecursively(java.io.File dir)Recursively delete a directory.static java.io.FiletoFile(java.net.URI uri)Convert a URI to a file but handle a corner case with UNC paths which do not parse correctly.static java.io.FiletoFile(java.net.URL url)Convert a URL to a file but handle a corner case with UNC paths which do not parse correctly.
-
-
-
Method Detail
-
toFile
public static java.io.File toFile(java.net.URL url) throws java.net.URISyntaxExceptionConvert 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:
java.net.URISyntaxException- if the URL cannot be converted to a URI
-
toFile
public static java.io.File toFile(java.net.URI uri)
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
public static void deleteRecursively(java.io.File dir) throws java.io.IOExceptionRecursively 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:
java.io.IOException- Security errors and any other IO errors encountered are raised as IOExceptions
-
-