private static void performBackup(String file, String type) { TFM_Log.info("Backing up " + file + " to " + file + "." + type + ".bak"); final File oldYaml = new File(TotalFreedomMod.plugin.getDataFolder(), file); final File newYaml = new File(TotalFreedomMod.plugin.getDataFolder(), file + "." + type + ".bak"); FileUtil.copy(oldYaml, newYaml); }
private void checkUpdate(File file) { if (updateDirectory == null || !updateDirectory.isDirectory()) { return; } File updateFile = new File(updateDirectory, file.getName()); if (updateFile.isFile() && FileUtil.copy(updateFile, file)) { updateFile.delete(); } }