package org.fakekoji;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URL;
import java.nio.file.Path;

public class Utils {

    private static final ClassLoader classLoader = Utils.class.getClassLoader();

    public static String readResource(Path path) throws IOException {
        return readFile(classLoader.getResource(path.toString()));
    }

    public static String readFile(File file) throws IOException {
        final StringBuilder content = new StringBuilder();
        final FileReader fileReader = new FileReader(file);
        final BufferedReader bufferedReader = new BufferedReader(fileReader);
        String line;
        while ((line = bufferedReader.readLine()) != null) {
            content.append(line);
        }
        bufferedReader.close();
        fileReader.close();
        return content.toString();
    }

    public static String readFile(URL url) throws IOException {
        return readFile(new File(url.getFile()));
    }

    public static void writeToFile(Path path, String content) throws IOException {
        writeToFile(path.toFile(), content);
    }

    public static void writeToFile(File file, String content) throws IOException {
        final PrintWriter writer = new PrintWriter(file.getAbsolutePath());
        writer.write(content);
        writer.flush();
        writer.close();
    }
}

@@ -193,20 +193,114 @@
 io.file.
-Path
+Files;%0Aimport java.nio.file.Path;%0A%0Aimport static java.nio.file.StandardCopyOption.REPLACE_EXISTING
 ;%0A%0Apubli
@@ -1532,11 +1532,169 @@
 );%0A    %7D
+%0A%0A    public static void moveFile(File source, File target) throws IOException %7B%0A        Files.move(source.toPath(), target.toPath(), REPLACE_EXISTING);%0A    %7D
 %0A%7D%0A

Create function for moving files