From 46da0094424df768fb92195a3f71071f66e3a442 Mon Sep 17 00:00:00 2001 From: DarioGii Date: Thu, 5 Dec 2024 11:09:51 +0000 Subject: [PATCH] 2270: Refactoring --- .../SPDF/config/security/database/DatabaseBackupHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/stirling/software/SPDF/config/security/database/DatabaseBackupHelper.java b/src/main/java/stirling/software/SPDF/config/security/database/DatabaseBackupHelper.java index 1da9b108b..b40f78c27 100644 --- a/src/main/java/stirling/software/SPDF/config/security/database/DatabaseBackupHelper.java +++ b/src/main/java/stirling/software/SPDF/config/security/database/DatabaseBackupHelper.java @@ -42,6 +42,7 @@ public class DatabaseBackupHelper implements DatabaseBackupInterface { private Path backupPath = Paths.get("configs/db/backup/"); + // fixMe: should check if backups exist without returning the whole list @Override public boolean hasBackup() { // Check if there is at least one backup @@ -51,6 +52,7 @@ public class DatabaseBackupHelper implements DatabaseBackupInterface { @Override public List getBackupList() { // Check if the backup directory exists, and create it if it does not + // todo: as this should always exist, can we make this an 'init' method so we do not have to check all the time? ensureBackupDirectoryExists(); List backupFiles = new ArrayList<>(); @@ -92,6 +94,7 @@ public class DatabaseBackupHelper implements DatabaseBackupInterface { } // Imports a database backup from the specified path. + // todo: make private? public boolean importDatabaseFromUI(Path tempTemplatePath) throws IOException { boolean success = executeDatabaseScript(tempTemplatePath); if (success) {