]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/Main.java
Use File instead of String
[signal-cli] / src / main / java / org / asamk / signal / Main.java
index 97e3f9b2e2760081f333f0626eb6b1695a79d532..6204778dd593469c43a6c69f9d8d831214e0056c 100644 (file)
@@ -212,17 +212,19 @@ public class Main {
      * @return the data directory to be used by signal-cli.
      */
     private static File getDefaultDataPath() {
-        File dataPath = new File(IOUtils.getDataHomeDir(), "/signal-cli");
+        File dataPath = new File(IOUtils.getDataHomeDir(), "signal-cli");
         if (dataPath.exists()) {
             return dataPath;
         }
 
-        File legacySettingsPath = new File(System.getProperty("user.home"), "/.config/signal");
+        File configPath = new File(System.getProperty("user.home"), ".config");
+
+        File legacySettingsPath = new File(configPath, "signal");
         if (legacySettingsPath.exists()) {
             return legacySettingsPath;
         }
 
-        legacySettingsPath = new File(System.getProperty("user.home"), "/.config/textsecure");
+        legacySettingsPath = new File(configPath, "textsecure");
         if (legacySettingsPath.exists()) {
             return legacySettingsPath;
         }