From 1df50093bd76315905a9aae880470e81b5e1d8f0 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sun, 24 Jan 2021 21:15:24 +0800 Subject: If incremental backup failed, unfinished copy will be fully reverted. --- src/main/java/com/keuin/kbackupfabric/KBCommands.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/com/keuin/kbackupfabric/KBCommands.java') diff --git a/src/main/java/com/keuin/kbackupfabric/KBCommands.java b/src/main/java/com/keuin/kbackupfabric/KBCommands.java index d9213c3..9c887fd 100644 --- a/src/main/java/com/keuin/kbackupfabric/KBCommands.java +++ b/src/main/java/com/keuin/kbackupfabric/KBCommands.java @@ -90,6 +90,7 @@ public final class KBCommands { // TODO: Show real name and size and etc info for incremental backup // TODO: Show concrete info from metadata for `.zip` backup MinecraftServer server = context.getSource().getMinecraftServer(); + // TODO: refactor this to use {@link ObjectCollectionSerializer#fromDirectory} File[] files = getBackupSaveDirectory(server).listFiles( (dir, name) -> dir.isDirectory() && (name.toLowerCase().endsWith(".zip") && name.toLowerCase().startsWith(getBackupFileNamePrefix()) @@ -100,6 +101,7 @@ public final class KBCommands { Objects.requireNonNull(file); if (file.getName().toLowerCase().endsWith(".zip")) return getPrimitiveBackupInformationString(file.getName(), file.length()); + // TODO: refactor this to use {@link ObjectCollectionSerializer#fromDirectory} else if (file.getName().toLowerCase().endsWith(".kbi")) return getIncrementalBackupInformationString(file); return file.getName(); -- cgit v1.2.3