diff options
author | Keuin <[email protected]> | 2021-01-13 19:39:55 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2021-01-13 19:39:55 +0800 |
commit | 5410762b8272feca0680f7a48f895714b91e3df7 (patch) | |
tree | dbb10ac9397c717683168d119d531dc0624e3722 /src/main/java/com/keuin/kbackupfabric | |
parent | e0c6a21fe9bfb01237fd145064f0af309879a9fb (diff) |
Add a more comprehensive test for incremental backup
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/util/backup/incremental/manager/IncrementalBackupStorageManager.java | 4 |
1 files changed, 4 insertions, 0 deletions
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); |