summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/operation/backup/feedback/IncrementalBackupFeedback.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-01-23 14:10:32 +0800
committerkeuin <[email protected]>2021-01-23 14:10:32 +0800
commit4a1d885afa7217b47d6183488c3dc6537cef05b6 (patch)
tree1b499db6b834cb0709029e30c0d52c0ddf200ffa /src/main/java/com/keuin/kbackupfabric/operation/backup/feedback/IncrementalBackupFeedback.java
parent4ac575330130ac4e1b4b35386ffc0aacd431a5a4 (diff)
Version 1.4.6 (preview): added metadata for incremental backup (need integrated test and display implementation)
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/operation/backup/feedback/IncrementalBackupFeedback.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/operation/backup/feedback/IncrementalBackupFeedback.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/operation/backup/feedback/IncrementalBackupFeedback.java b/src/main/java/com/keuin/kbackupfabric/operation/backup/feedback/IncrementalBackupFeedback.java
index f39fde6..1a05c8c 100644
--- a/src/main/java/com/keuin/kbackupfabric/operation/backup/feedback/IncrementalBackupFeedback.java
+++ b/src/main/java/com/keuin/kbackupfabric/operation/backup/feedback/IncrementalBackupFeedback.java
@@ -1,12 +1,15 @@
package com.keuin.kbackupfabric.operation.backup.feedback;
+import com.keuin.kbackupfabric.backup.incremental.manager.IncCopyResult;
+import org.jetbrains.annotations.Nullable;
+
public class IncrementalBackupFeedback implements BackupFeedback {
private final boolean success;
- private final int newFilesAdded;
+ private final IncCopyResult copyResult;
- public IncrementalBackupFeedback(boolean success, int newFilesAdded) {
+ public IncrementalBackupFeedback(boolean success, @Nullable IncCopyResult copyResult) {
this.success = success;
- this.newFilesAdded = newFilesAdded;
+ this.copyResult = copyResult;
}
@Override
@@ -14,15 +17,15 @@ public class IncrementalBackupFeedback implements BackupFeedback {
return success;
}
- public long getNewFilesAdded() {
- return newFilesAdded;
+ public IncCopyResult getCopyResult() {
+ return copyResult;
}
@Override
public String getFeedback() {
- if (success && newFilesAdded >= 0)
- return String.format("File(s) added: %d.", newFilesAdded);
+ if (success && copyResult != null)
+ return String.format("File(s) added: %s.", copyResult);
else
- return "";
+ return "Backup failed.";
}
}