summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/operation/DeleteOperation.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/operation/DeleteOperation.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/operation/DeleteOperation.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/operation/DeleteOperation.java b/src/main/java/com/keuin/kbackupfabric/operation/DeleteOperation.java
index 1e28324..be7734d 100644
--- a/src/main/java/com/keuin/kbackupfabric/operation/DeleteOperation.java
+++ b/src/main/java/com/keuin/kbackupfabric/operation/DeleteOperation.java
@@ -1,10 +1,9 @@
package com.keuin.kbackupfabric.operation;
+import com.keuin.kbackupfabric.util.PrintUtil;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.IOException;
@@ -15,9 +14,9 @@ import static com.keuin.kbackupfabric.util.PrintUtil.msgErr;
import static com.keuin.kbackupfabric.util.PrintUtil.msgInfo;
import static org.apache.commons.io.FileUtils.forceDelete;
-class DeleteOperation extends Confirmable {
+class DeleteOperation extends AbstractConfirmableOperation {
- private static final Logger LOGGER = LogManager.getLogger();
+ //private static final Logger LOGGER = LogManager.getLogger();
private final String backupName;
private final CommandContext<ServerCommandSource> context;
@@ -30,13 +29,13 @@ class DeleteOperation extends Confirmable {
public boolean confirm() {
MinecraftServer server = context.getSource().getMinecraftServer();
String backupFileName = getBackupFileName(backupName);
- LOGGER.info("Deleting backup " + backupName);
+ PrintUtil.info("Deleting backup " + backupName);
File backupFile = new File(getBackupSaveDirectory(server), backupFileName);
int tryCounter = 0;
do {
if (tryCounter == 5) {
String msg = "Failed to delete file " + backupFileName;
- LOGGER.error(msg);
+ PrintUtil.error(msg);
msgErr(context, msg);
return false;
}
@@ -47,7 +46,7 @@ class DeleteOperation extends Confirmable {
}
++tryCounter;
} while (backupFile.exists());
- LOGGER.info("Deleted backup " + backupName);
+ PrintUtil.info("Deleted backup " + backupName);
msgInfo(context, "Deleted backup " + backupName);
return true;
}