summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-01-25 02:07:54 +0800
committerkeuin <[email protected]>2021-01-25 02:12:53 +0800
commit43d48aa979a1e316af5ba0445412fe8926ce983b (patch)
treeae1419a6c09d286e3604d52bd6f86e807bfbd98d /src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer
parent1df50093bd76315905a9aae880470e81b5e1d8f0 (diff)
Perform clean-up after deleting a backup.
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/IncBackupInfoSerializer.java4
-rw-r--r--src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncBackupV1.java4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/IncBackupInfoSerializer.java b/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/IncBackupInfoSerializer.java
index d084aef..e79c02f 100644
--- a/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/IncBackupInfoSerializer.java
+++ b/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/IncBackupInfoSerializer.java
@@ -41,8 +41,12 @@ public class IncBackupInfoSerializer {
}
} catch (ClassNotFoundException e) {
// this should not happen
+ e.printStackTrace();
throw new RuntimeException(e);
}
+ } catch (Exception e) {
+ System.err.println("Failed to deserialize file " + file.getName());
+ throw e;
}
}
diff --git a/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncBackupV1.java b/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncBackupV1.java
index bd2d4eb..e34efdb 100644
--- a/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncBackupV1.java
+++ b/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncBackupV1.java
@@ -6,10 +6,12 @@ import com.keuin.kbackupfabric.util.DateUtil;
import java.io.Serializable;
import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.Objects;
public class SavedIncBackupV1 implements SavedIncrementalBackup, Serializable {
+ private static final long serialVersionUID = 5798490056955510205L;
private final ObjectCollection2 objectCollection2;
private final String backupName;
private final ZonedDateTime backupTime;
@@ -17,6 +19,8 @@ public class SavedIncBackupV1 implements SavedIncrementalBackup, Serializable {
private final long increasedSizeBytes;
private final int filesAdded;
private final int totalFiles;
+ // this field is depreciated and kept only for serialization compatibility
+ private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss");
public SavedIncBackupV1(ObjectCollection2 objectCollection2, String backupName, ZonedDateTime backupTime, long totalSizeBytes, long increasedSizeBytes, int filesAdded, int totalFiles) {
this.totalFiles = totalFiles;