Use File instead of String

This commit is contained in:
AsamK 2020-12-25 23:07:36 +01:00
parent 5c754b6f5d
commit 22f19c4067
7 changed files with 61 additions and 54 deletions

View 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;
}