From 5410762b8272feca0680f7a48f895714b91e3df7 Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 13 Jan 2021 19:39:55 +0800 Subject: Add a more comprehensive test for incremental backup --- .../backup/incremental/manager/IncrementalBackupStorageManager.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/java/com/keuin/kbackupfabric/util') diff --git a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/manager/IncrementalBackupStorageManager.java b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/manager/IncrementalBackupStorageManager.java index a4271c6..6c359c6 100644 --- a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/manager/IncrementalBackupStorageManager.java +++ b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/manager/IncrementalBackupStorageManager.java @@ -30,6 +30,10 @@ public class IncrementalBackupStorageManager { * @throws IOException I/O Error. */ public int addObjectCollection(ObjectCollection collection, File collectionBasePath) throws IOException { + if (!backupStorageBase.toFile().isDirectory()) { + if (!backupStorageBase.toFile().mkdirs()) + throw new IOException("Backup storage base directory does not exist, and failed to create it."); + } Objects.requireNonNull(collection); Objects.requireNonNull(collectionBasePath); -- cgit v1.2.3