Closed gra-m closed 2 years ago
String oldDBName = this.fileHandler.getDbFileName(); boolean oldFileDeleted = this.fileHandler.deleteFile(); try { if (oldFileDeleted) { this.fileHandler.close(); Files.copy(tmpFile.toPath(), FileSystems.getDefault().getPath("", oldDBName), StandardCopyOption.REPLACE_EXISTING); this.fileHandler = new FileHandler(oldDBName); } else { tmpFile.delete(); this.initialise(); // throw new IOException("Old DB file could not be deleted, defrag failed, check logs"); } }catch (IOException e) { e.printStackTrace(); } ![image](https://user-images.githubusercontent.com/91182298/177924071-3e238275-7f6a-4242-bc49-0e9e3b7de05b.png)