package net.shadowfacts.enfusion.util;

import net.shadowfacts.enfusion.EnFusion;

import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;

/**
 * @author shadowfacts
 */
public class UpdateUtils {

	public static void tryMoveLegacyConfig(File configFolder) {
		Path oldPath = FileSystems.getDefault().getPath(configFolder.getPath(), "enfusion.cfg");
		if (Files.exists(oldPath)) {
			try {
				Path newPath = FileSystems.getDefault().getPath(configFolder.getPath(), "shadow", "EnFusion.cfg");
				Files.move(oldPath, newPath);
			} catch (IOException e) {
				EnFusion.log.error("There was a problem trying to move the old config file to the new location.");
				e.printStackTrace();
			}
		}
	}

}

@@ -457,16 +457,99 @@
 ath)) %7B%0A
+%09%09%09EnFusion.log.info(%22Attempting to migrate legacy config file to new location.%22);%0A
 %09%09%09try %7B

Add log statement