From 4a1d885afa7217b47d6183488c3dc6537cef05b6 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 23 Jan 2021 14:10:32 +0800 Subject: Version 1.4.6 (preview): added metadata for incremental backup (need integrated test and display implementation) --- .../backup/feedback/IncrementalBackupFeedback.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/keuin/kbackupfabric/operation/backup/feedback') 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."; } } -- cgit v1.2.3