From fd0cc63e7cb0611fc68e1bbb5f5ac3156ac1e365 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Thu, 1 Oct 2020 16:53:06 -0500 Subject: [PATCH] Refactor: use FileUtil.removeAndBackupFile instead of FileManager.removeAndBackupFile --- .../dao/monitoring/DaoStateMonitoringService.java | 4 ++-- .../bisq/core/dao/state/DaoStateStorageService.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/bisq/core/dao/monitoring/DaoStateMonitoringService.java b/core/src/main/java/bisq/core/dao/monitoring/DaoStateMonitoringService.java index c486ee4a04..604746bcbb 100644 --- a/core/src/main/java/bisq/core/dao/monitoring/DaoStateMonitoringService.java +++ b/core/src/main/java/bisq/core/dao/monitoring/DaoStateMonitoringService.java @@ -39,7 +39,7 @@ import bisq.network.p2p.seed.SeedNodeRepository; import bisq.common.UserThread; import bisq.common.config.Config; import bisq.common.crypto.Hash; -import bisq.common.storage.FileManager; +import bisq.common.file.FileUtil; import bisq.common.util.Utilities; import javax.inject.Inject; @@ -419,7 +419,7 @@ public class DaoStateMonitoringService implements DaoSetupService, DaoStateListe File corrupted = new File(storageDir, storeName); try { if (corrupted.exists()) { - FileManager.removeAndBackupFile(storageDir, corrupted, newFileName, backupDirName); + FileUtil.removeAndBackupFile(storageDir, corrupted, newFileName, backupDirName); } } catch (Throwable t) { t.printStackTrace(); diff --git a/core/src/main/java/bisq/core/dao/state/DaoStateStorageService.java b/core/src/main/java/bisq/core/dao/state/DaoStateStorageService.java index 8571eb2b12..d3c58e990b 100644 --- a/core/src/main/java/bisq/core/dao/state/DaoStateStorageService.java +++ b/core/src/main/java/bisq/core/dao/state/DaoStateStorageService.java @@ -26,7 +26,7 @@ import bisq.network.p2p.storage.persistence.StoreService; import bisq.common.UserThread; import bisq.common.config.Config; -import bisq.common.storage.FileManager; +import bisq.common.file.FileUtil; import bisq.common.storage.Storage; import javax.inject.Inject; @@ -114,20 +114,20 @@ public class DaoStateStorageService extends StoreService { long currentTime = System.currentTimeMillis(); String backupDirName = "out_of_sync_dao_data"; String newFileName = "BlindVoteStore_" + currentTime; - FileManager.removeAndBackupFile(storageDir, new File(storageDir, "BlindVoteStore"), newFileName, backupDirName); + FileUtil.removeAndBackupFile(storageDir, new File(storageDir, "BlindVoteStore"), newFileName, backupDirName); newFileName = "ProposalStore_" + currentTime; - FileManager.removeAndBackupFile(storageDir, new File(storageDir, "ProposalStore"), newFileName, backupDirName); + FileUtil.removeAndBackupFile(storageDir, new File(storageDir, "ProposalStore"), newFileName, backupDirName); // We also need to remove ballot list as it contains the proposals as well. It will be recreated at resync newFileName = "BallotList_" + currentTime; - FileManager.removeAndBackupFile(storageDir, new File(storageDir, "BallotList"), newFileName, backupDirName); + FileUtil.removeAndBackupFile(storageDir, new File(storageDir, "BallotList"), newFileName, backupDirName); newFileName = "UnconfirmedBsqChangeOutputList_" + currentTime; - FileManager.removeAndBackupFile(storageDir, new File(storageDir, "UnconfirmedBsqChangeOutputList"), newFileName, backupDirName); + FileUtil.removeAndBackupFile(storageDir, new File(storageDir, "UnconfirmedBsqChangeOutputList"), newFileName, backupDirName); newFileName = "DaoStateStore_" + currentTime; - FileManager.removeAndBackupFile(storageDir, new File(storageDir, "DaoStateStore"), newFileName, backupDirName); + FileUtil.removeAndBackupFile(storageDir, new File(storageDir, "DaoStateStore"), newFileName, backupDirName); }