diff options
author | Keuin <[email protected]> | 2021-01-24 21:15:24 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2021-01-25 02:12:49 +0800 |
commit | 1df50093bd76315905a9aae880470e81b5e1d8f0 (patch) | |
tree | f94b4d2847c2da2c820e708b6664c3246992e581 /src/main/java/com/keuin/kbackupfabric/KBCommands.java | |
parent | 3648d0ca94c9954fa7c4797ce64a0f42a4f837b5 (diff) |
If incremental backup failed, unfinished copy will be fully reverted.
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBCommands.java')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/KBCommands.java | 2 |
1 files changed, 2 insertions, 0 deletions
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(); |