mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-28 13:45:14 +01:00
Changed move file to copy and delete in FlatFile.
This commit is contained in:
parent
21c259f628
commit
4fc63b6de0
@ -98,9 +98,10 @@ public class FlatFileDatabaseConnecter implements DatabaseConnecter {
|
||||
File tmpFile = File.createTempFile("yaml", null, tableFolder);
|
||||
yamlConfig.save(tmpFile);
|
||||
if (tmpFile.exists()) {
|
||||
Files.move(tmpFile.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE);
|
||||
Files.copy(tmpFile.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
Files.delete(tmpFile.toPath());
|
||||
} else {
|
||||
throw new Exception();
|
||||
throw new IOException();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
plugin.logError("Could not save yaml file: " + tableName + " " + fileName + " " + e.getMessage());
|
||||
|
Loading…
Reference in New Issue
Block a user