Class FileUtils
java.lang.Object
net.neoforged.moddevgradle.internal.utils.FileUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidatomicMove(Path source, Path destination) Atomically moves the given source file to the given destination file.Finds an explicitly defined Java module name in the given Jar file.static Stringstatic OutputStreamnewSafeFileOutputStream(Path destination) static voidwriteLinesSafe(Path destination, List<String> lines, Charset charset) static voidwriteStringSafe(Path destination, String content, Charset charset)
-
Method Details
-
getExplicitJavaModuleName
Finds an explicitly defined Java module name in the given Jar file.- Throws:
IOException
-
hashFile
-
writeStringSafe
public static void writeStringSafe(Path destination, String content, Charset charset) throws IOException - Throws:
IOException
-
writeLinesSafe
public static void writeLinesSafe(Path destination, List<String> lines, Charset charset) throws IOException - Throws:
IOException
-
newSafeFileOutputStream
- Throws:
IOException
-
atomicMove
Atomically moves the given source file to the given destination file.- Parameters:
source- The source filedestination- The destination file- Throws:
IOException- If an I/O error occurs
-