Merge pull request #5 from blha303/master
Added file renaming for backup
This commit is contained in:
@@ -127,6 +127,9 @@ public class VaultManager {
|
|||||||
*/
|
*/
|
||||||
public void saveFile(String name, YamlConfiguration yaml) throws IOException {
|
public void saveFile(String name, YamlConfiguration yaml) throws IOException {
|
||||||
File file = new File(directory + File.separator + name.toLowerCase() + ".yml");
|
File file = new File(directory + File.separator + name.toLowerCase() + ".yml");
|
||||||
|
if (file.exists()) {
|
||||||
|
file.renameTo(new File(directory + File.separator + name.toLowerCase() + ".yml.bak"));
|
||||||
|
}
|
||||||
yaml.save(file);
|
yaml.save(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user