summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/util/backup/name/BackupFileNameEncoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/util/backup/name/BackupFileNameEncoder.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/util/backup/name/BackupFileNameEncoder.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/util/backup/name/BackupFileNameEncoder.java b/src/main/java/com/keuin/kbackupfabric/util/backup/name/BackupFileNameEncoder.java
index 83967b7..972403b 100644
--- a/src/main/java/com/keuin/kbackupfabric/util/backup/name/BackupFileNameEncoder.java
+++ b/src/main/java/com/keuin/kbackupfabric/util/backup/name/BackupFileNameEncoder.java
@@ -1,6 +1,7 @@
package com.keuin.kbackupfabric.util.backup.name;
import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
/**
* Encode and decode backup file name for a specific backup type.
@@ -38,12 +39,20 @@ public interface BackupFileNameEncoder {
}
class BackupBasicInformation {
+
public final String customName;
public final LocalDateTime time;
+ private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm.ss");
+
BackupBasicInformation(String customName, LocalDateTime time) {
this.customName = customName;
this.time = time;
}
+
+ @Override
+ public String toString() {
+ return String.format("%s, %s", customName, time.format(formatter));
+ }
}
}