mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-02 13:48:15 +02:00
2270: Refactoring
This commit is contained in:
parent
a2c30b6d2f
commit
46da009442
@ -42,6 +42,7 @@ public class DatabaseBackupHelper implements DatabaseBackupInterface {
|
|||||||
|
|
||||||
private Path backupPath = Paths.get("configs/db/backup/");
|
private Path backupPath = Paths.get("configs/db/backup/");
|
||||||
|
|
||||||
|
// fixMe: should check if backups exist without returning the whole list
|
||||||
@Override
|
@Override
|
||||||
public boolean hasBackup() {
|
public boolean hasBackup() {
|
||||||
// Check if there is at least one backup
|
// Check if there is at least one backup
|
||||||
@ -51,6 +52,7 @@ public class DatabaseBackupHelper implements DatabaseBackupInterface {
|
|||||||
@Override
|
@Override
|
||||||
public List<FileInfo> getBackupList() {
|
public List<FileInfo> getBackupList() {
|
||||||
// Check if the backup directory exists, and create it if it does not
|
// 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();
|
ensureBackupDirectoryExists();
|
||||||
|
|
||||||
List<FileInfo> backupFiles = new ArrayList<>();
|
List<FileInfo> backupFiles = new ArrayList<>();
|
||||||
@ -92,6 +94,7 @@ public class DatabaseBackupHelper implements DatabaseBackupInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Imports a database backup from the specified path.
|
// Imports a database backup from the specified path.
|
||||||
|
// todo: make private?
|
||||||
public boolean importDatabaseFromUI(Path tempTemplatePath) throws IOException {
|
public boolean importDatabaseFromUI(Path tempTemplatePath) throws IOException {
|
||||||
boolean success = executeDatabaseScript(tempTemplatePath);
|
boolean success = executeDatabaseScript(tempTemplatePath);
|
||||||
if (success) {
|
if (success) {
|
||||||
|
Loading…
Reference in New Issue
Block a user