summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-01-13 13:23:31 +0800
committerkeuin <[email protected]>2021-01-13 13:23:31 +0800
commit1c6d68ee303ad3d4b1df5c3d433bf972256f0c8e (patch)
treee382399ce21281e0af7e0bf237339fdf017abd70 /src
parentc82e1ee286e89f6e36e8920282d348ce8cfae9cf (diff)
Refactor for a better code quality
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java4
-rw-r--r--src/main/java/com/keuin/kbackupfabric/operation/backup/method/BackupMethod.java5
-rw-r--r--src/main/java/com/keuin/kbackupfabric/operation/backup/method/IncrementalBackupMethod.java2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java b/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java
index 3183cf0..0ff2c40 100644
--- a/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java
+++ b/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java
@@ -52,8 +52,8 @@ public class BackupOperation extends InvokableAsyncBlockingOperation {
String levelPath = getLevelPath(server);
String backupFileName = getBackupFileName(customBackupName);
- BackupFeedback result = backupMethod.backup(customBackupName,levelPath,backupSaveDirectory);
- if(result.isSuccess()) {
+ BackupFeedback result = backupMethod.backup(customBackupName, levelPath, backupSaveDirectory);
+ if (result.isSuccess()) {
// Restore old auto-save switch stat
server.getWorlds().forEach(world -> world.savingDisabled = oldWorldsSavingDisabled.getOrDefault(world, true));
diff --git a/src/main/java/com/keuin/kbackupfabric/operation/backup/method/BackupMethod.java b/src/main/java/com/keuin/kbackupfabric/operation/backup/method/BackupMethod.java
index 25a5952..7afbabd 100644
--- a/src/main/java/com/keuin/kbackupfabric/operation/backup/method/BackupMethod.java
+++ b/src/main/java/com/keuin/kbackupfabric/operation/backup/method/BackupMethod.java
@@ -12,10 +12,11 @@ public interface BackupMethod {
/**
* Perform a backup with given method. The backup will be saved as the given name.
* Note: real file name depends on the backup type.
- * @param backupName the backup name.
+ *
+ * @param customBackupName the custom backup name.
* @return if the backup operation succeed.
*/
- BackupFeedback backup(String backupName, String levelPath, String backupSaveDirectory) throws IOException;
+ BackupFeedback backup(String customBackupName, String levelPath, String backupSaveDirectory) throws IOException;
boolean restore(String backupName, String levelPath, String backupSaveDirectory) throws IOException;
diff --git a/src/main/java/com/keuin/kbackupfabric/operation/backup/method/IncrementalBackupMethod.java b/src/main/java/com/keuin/kbackupfabric/operation/backup/method/IncrementalBackupMethod.java
index 1dacc44..25e5731 100644
--- a/src/main/java/com/keuin/kbackupfabric/operation/backup/method/IncrementalBackupMethod.java
+++ b/src/main/java/com/keuin/kbackupfabric/operation/backup/method/IncrementalBackupMethod.java
@@ -6,7 +6,7 @@ import java.io.IOException;
public class IncrementalBackupMethod implements BackupMethod {
@Override
- public IncrementalBackupFeedback backup(String backupName, String levelPath, String backupSaveDirectory) throws IOException {
+ public IncrementalBackupFeedback backup(String customBackupName, String levelPath, String backupSaveDirectory) throws IOException {
return null;
}