From ac7e70883c18602e7fd4b525b9e6fb9ea9620a6b Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 20 Jan 2021 19:50:42 +0800 Subject: refactor --- .../backup/provider/AvailableBackupProvider.java | 8 ++++++++ .../backup/provider/IncrementalBackupInformation.java | 13 +++++++++++++ .../backup/provider/PrimitiveBackupInformation.java | 14 ++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 src/main/java/com/keuin/kbackupfabric/backup/provider/AvailableBackupProvider.java create mode 100644 src/main/java/com/keuin/kbackupfabric/backup/provider/IncrementalBackupInformation.java create mode 100644 src/main/java/com/keuin/kbackupfabric/backup/provider/PrimitiveBackupInformation.java (limited to 'src/main/java/com/keuin/kbackupfabric/backup/provider') diff --git a/src/main/java/com/keuin/kbackupfabric/backup/provider/AvailableBackupProvider.java b/src/main/java/com/keuin/kbackupfabric/backup/provider/AvailableBackupProvider.java new file mode 100644 index 0000000..43a7a01 --- /dev/null +++ b/src/main/java/com/keuin/kbackupfabric/backup/provider/AvailableBackupProvider.java @@ -0,0 +1,8 @@ +package com.keuin.kbackupfabric.backup.provider; + +/** + * List all backup in disk. Provide their basic information as soon as possible. + */ +public class AvailableBackupProvider { + // TODO: remove obsolete impl. in command user interface. Use this instead. +} diff --git a/src/main/java/com/keuin/kbackupfabric/backup/provider/IncrementalBackupInformation.java b/src/main/java/com/keuin/kbackupfabric/backup/provider/IncrementalBackupInformation.java new file mode 100644 index 0000000..4c4f847 --- /dev/null +++ b/src/main/java/com/keuin/kbackupfabric/backup/provider/IncrementalBackupInformation.java @@ -0,0 +1,13 @@ +package com.keuin.kbackupfabric.backup.provider; + +import com.keuin.kbackupfabric.backup.name.BackupFileNameEncoder; + +import java.time.LocalDateTime; + +public class IncrementalBackupInformation extends BackupFileNameEncoder.BackupBasicInformation { + // TODO: show total size for incremental backup + + public IncrementalBackupInformation(String customName, LocalDateTime time) { + super(customName, time); + } +} diff --git a/src/main/java/com/keuin/kbackupfabric/backup/provider/PrimitiveBackupInformation.java b/src/main/java/com/keuin/kbackupfabric/backup/provider/PrimitiveBackupInformation.java new file mode 100644 index 0000000..53f049c --- /dev/null +++ b/src/main/java/com/keuin/kbackupfabric/backup/provider/PrimitiveBackupInformation.java @@ -0,0 +1,14 @@ +package com.keuin.kbackupfabric.backup.provider; + +import com.keuin.kbackupfabric.backup.name.BackupFileNameEncoder; + +import java.time.LocalDateTime; + +public class PrimitiveBackupInformation extends BackupFileNameEncoder.BackupBasicInformation { + public final long sizeBytes; + + public PrimitiveBackupInformation(String customName, LocalDateTime time, long sizeBytes) { + super(customName, time); + this.sizeBytes = sizeBytes; + } +} -- cgit v1.2.3