]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/manager/PathConfig.java
Refactor Manager to always have a valid SignalAccount instance
[signal-cli] / src / main / java / org / asamk / signal / manager / PathConfig.java
diff --git a/src/main/java/org/asamk/signal/manager/PathConfig.java b/src/main/java/org/asamk/signal/manager/PathConfig.java
new file mode 100644 (file)
index 0000000..2c2d938
--- /dev/null
@@ -0,0 +1,34 @@
+package org.asamk.signal.manager;
+
+public class PathConfig {
+
+    private final String dataPath;
+    private final String attachmentsPath;
+    private final String avatarsPath;
+
+    public static PathConfig createDefault(final String settingsPath) {
+        return new PathConfig(
+                settingsPath + "/data",
+                settingsPath + "/attachments",
+                settingsPath + "/avatars"
+        );
+    }
+
+    private PathConfig(final String dataPath, final String attachmentsPath, final String avatarsPath) {
+        this.dataPath = dataPath;
+        this.attachmentsPath = attachmentsPath;
+        this.avatarsPath = avatarsPath;
+    }
+
+    public String getDataPath() {
+        return dataPath;
+    }
+
+    public String getAttachmentsPath() {
+        return attachmentsPath;
+    }
+
+    public String getAvatarsPath() {
+        return avatarsPath;
+    }
+}