From 2bc659d8f95a97d0514491e48ed9c66828a4e308 Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 13 Jan 2021 14:32:08 +0800 Subject: BackupMethod now becomes stateful --- .../util/backup/incremental/ObjectCollectionFactory.java | 2 +- .../util/backup/name/IncrementalBackupFileNameEncoder.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/keuin/kbackupfabric/util/backup') diff --git a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionFactory.java b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionFactory.java index ac87883..627cb5c 100644 --- a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionFactory.java +++ b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionFactory.java @@ -15,7 +15,7 @@ import java.util.*; * identifiers. Usually, identifier is the combination of hash and other short information (such as size and another hash). * The identifier should use hashes that are strong enough, to prevent possible collisions. */ -public class ObjectCollectionFactory { +public class ObjectCollectionFactory { private final FileIdentifierProvider identifierFactory; diff --git a/src/main/java/com/keuin/kbackupfabric/util/backup/name/IncrementalBackupFileNameEncoder.java b/src/main/java/com/keuin/kbackupfabric/util/backup/name/IncrementalBackupFileNameEncoder.java index ae54930..a0d4128 100644 --- a/src/main/java/com/keuin/kbackupfabric/util/backup/name/IncrementalBackupFileNameEncoder.java +++ b/src/main/java/com/keuin/kbackupfabric/util/backup/name/IncrementalBackupFileNameEncoder.java @@ -9,6 +9,10 @@ public class IncrementalBackupFileNameEncoder implements BackupFileNameEncoder { private static final String backupFileNamePrefix = "incremental-"; private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"); + // TODO: make this private and use singleton pattern + public IncrementalBackupFileNameEncoder() { + } + @Override public String encode(String customName, LocalDateTime time) { if (!isValidCustomName(customName)) -- cgit v1.2.3