From ea01faf3947814fe7ecaa3705e5fbf0f171f7e48 Mon Sep 17 00:00:00 2001 From: Keuin Date: Fri, 24 Apr 2020 13:43:20 +0800 Subject: Added hint at the "/kb" output in the first run after restoring from a backup. Warning: Backup in this version is not compatible with older version! --- .../kbackupfabric/metadata/MetadataHolder.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java (limited to 'src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java') diff --git a/src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java b/src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java new file mode 100644 index 0000000..4180a19 --- /dev/null +++ b/src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java @@ -0,0 +1,22 @@ +package com.keuin.kbackupfabric.metadata; + +/** + * In the first startup after restoring from a previous backup, the metadata is stored in this class. + * The setMetadata can only be called when startup + */ +public class MetadataHolder { + private static BackupMetadata metadata = null; + + public static BackupMetadata getMetadata() { + return metadata; + } + + public static void setMetadata(BackupMetadata metadata) { + if (MetadataHolder.metadata == null) + MetadataHolder.metadata = metadata; + } + + public static boolean hasMetadata() { + return MetadataHolder.metadata != null; + } +} -- cgit v1.2.3