add a config option to disable backups. closes #45

This commit is contained in:
Joshua Popoff
2014-11-24 00:40:15 -08:00
parent e8bbd49804
commit b8b7c24d9d
4 changed files with 18 additions and 5 deletions
@@ -239,7 +239,7 @@ public class UUIDVaultManager {
*/
public void saveFile(UUID holder, YamlConfiguration yaml) throws IOException {
File file = new File(directory, holder.toString() + ".yml");
if (file.exists()) {
if (file.exists() && PlayerVaults.getInstance().isBackupsEnabled()) {
file.renameTo(new File(PlayerVaults.getInstance().getBackupsFolder(), holder.toString() + ".yml"));
}
yaml.save(file);
@@ -33,6 +33,7 @@ import java.util.List;
/**
* A class for managing actual IO to the files, loading inventories, and saving them.
*/
@Deprecated
public class VaultManager {
public PlayerVaults plugin;
@@ -260,9 +261,9 @@ public class VaultManager {
@Deprecated
public void saveFile(String holder, YamlConfiguration yaml) throws IOException {
File file = new File(directory + File.separator + holder.toLowerCase() + ".yml");
if (file.exists()) {
if (file.exists() && PlayerVaults.getInstance().isBackupsEnabled()) {
file.renameTo(new File(PlayerVaults.getInstance().getBackupsFolder(), holder.toLowerCase() + ".yml"));
}
yaml.save(file);
}
}
}