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.static OutputStreamnewSafeFileOutputStream(Path destination) static voidwriteLinesSafe(Path destination, List<String> lines, Charset charset) static voidwriteStringSafe(Path destination, String content, Charset charset)
-
Method Details
-
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
-