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! --- src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java | 9 +++++++++ src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/keuin/kbackupfabric/util') diff --git a/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java b/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java index ca00ad4..11995e7 100644 --- a/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java +++ b/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java @@ -15,11 +15,16 @@ public final class PrintUtil { private static final Object syncMessage = new Object(); private static final Style infoStyle = new Style().setColor(Formatting.WHITE); + private static final Style stressStyle = new Style().setColor(Formatting.AQUA).setBold(true); private static final Style warnStyle = new Style().setColor(Formatting.YELLOW); private static final Style errorStyle = new Style().setColor(Formatting.DARK_RED); private static final Logger LOGGER = LogManager.getLogger(); + public static CommandContext msgStress(CommandContext context, String messageText) { + return msgStress(context, messageText, false); + } + public static CommandContext msgInfo(CommandContext context, String messageText) { return msgInfo(context, messageText, false); } @@ -32,6 +37,10 @@ public final class PrintUtil { return msgErr(context, messageText, false); } + public static CommandContext msgStress(CommandContext context, String messageText, boolean broadcastToOps) { + return message(context, messageText, broadcastToOps, stressStyle); + } + public static CommandContext msgInfo(CommandContext context, String messageText, boolean broadcastToOps) { return message(context, messageText, broadcastToOps, infoStyle); } diff --git a/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java b/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java index e819afc..ee2907e 100644 --- a/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java +++ b/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java @@ -1,6 +1,6 @@ package com.keuin.kbackupfabric.util; -import com.keuin.kbackupfabric.data.BackupMetadata; +import com.keuin.kbackupfabric.metadata.BackupMetadata; import java.io.*; import java.util.Enumeration; @@ -21,6 +21,9 @@ public final class ZipUtil { return; } + if (file.getName().equals(BackupMetadata.metadataFileName)) + return; // Reject + // 如果是文件,则直接压缩该文件 if (file.isFile()) { int count, bufferLen = 1024; -- cgit v1.2.3