summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/util/backup/builder/PrimitiveZipBackupFileNameBuilder.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-08-02 18:31:50 +0800
committerkeuin <[email protected]>2020-08-02 18:31:50 +0800
commitd9c2af035ac2edb68bc8b6a1f94b7c772c3509c8 (patch)
tree4a27dd9a313090ae75d35e4d27d5bdd40b1eb218 /src/main/java/com/keuin/kbackupfabric/util/backup/builder/PrimitiveZipBackupFileNameBuilder.java
parentf09d420df609194a17e9d9ec63d710df8135aa8e (diff)
Refactor & object tree impl. stage 1
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/util/backup/builder/PrimitiveZipBackupFileNameBuilder.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/util/backup/builder/PrimitiveZipBackupFileNameBuilder.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/util/backup/builder/PrimitiveZipBackupFileNameBuilder.java b/src/main/java/com/keuin/kbackupfabric/util/backup/builder/PrimitiveZipBackupFileNameBuilder.java
new file mode 100644
index 0000000..f910c37
--- /dev/null
+++ b/src/main/java/com/keuin/kbackupfabric/util/backup/builder/PrimitiveZipBackupFileNameBuilder.java
@@ -0,0 +1,22 @@
+package com.keuin.kbackupfabric.util.backup.builder;
+
+import com.keuin.kbackupfabric.util.backup.BackupFilesystemUtil;
+import com.keuin.kbackupfabric.util.backup.BackupNameTimeFormatter;
+
+import java.time.LocalDateTime;
+
+public class PrimitiveZipBackupFileNameBuilder implements BackupFileNameBuilder {
+
+ private static final PrimitiveZipBackupFileNameBuilder instance = new PrimitiveZipBackupFileNameBuilder();
+
+ public static PrimitiveZipBackupFileNameBuilder getInstance() {
+ return instance;
+ }
+
+ @Override
+ public String build(LocalDateTime time, String backupName) {
+ String timeString = BackupNameTimeFormatter.localDateTimeToString(time);
+ return String.format("%s%s_%s%s", BackupFilesystemUtil.getBackupFileNamePrefix(),timeString,backupName,".zip");
+ }
+
+}