diff options
author | Pacien TRAN-GIRARD | 2017-07-11 14:49:08 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2017-07-11 14:49:08 +0200 |
commit | a2bfd75dee9b4952771a66c555ba1d920a072ae9 (patch) | |
tree | 3fcf598fe4e8fe858b296089f651a198b4e5f47c /app/src/main/java/org/pacien/tincapp/context | |
parent | 336a8f9cc02b2f78796fd10ea6244e5d0bc725c7 (diff) | |
download | tincapp-a2bfd75dee9b4952771a66c555ba1d920a072ae9.tar.gz |
Implement create and join network dialogs + refactoring
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/context')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/context/AppPaths.kt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt b/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt index 078a81d..c745d4d 100644 --- a/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt +++ b/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt | |||
@@ -16,13 +16,17 @@ object AppPaths { | |||
16 | private val PIDFILE_FORMAT = "tinc.%s.pid" | 16 | private val PIDFILE_FORMAT = "tinc.%s.pid" |
17 | 17 | ||
18 | private val NET_CONF_FILE = "network.conf" | 18 | private val NET_CONF_FILE = "network.conf" |
19 | private val NET_HOSTS_DIR = "hosts" | ||
20 | private val NET_INVITATION_FILE = "invitation-data" | ||
19 | 21 | ||
20 | fun cacheDir() = App.getContext().externalCacheDir!! | 22 | fun cacheDir() = App.getContext().externalCacheDir!! |
21 | fun confDir() = App.getContext().getExternalFilesDir(null)!! | 23 | fun confDir() = App.getContext().getExternalFilesDir(null)!! |
22 | fun binDir() = File(App.getContext().applicationInfo.nativeLibraryDir) | 24 | fun binDir() = File(App.getContext().applicationInfo.nativeLibraryDir) |
23 | 25 | ||
24 | fun confDir(netName: String) = File(confDir(), netName) | 26 | fun confDir(netName: String) = File(confDir(), netName) |
27 | fun hostsDir(netName: String) = File(confDir(netName), NET_HOSTS_DIR) | ||
25 | fun netConfFile(netName: String) = File(confDir(netName), NET_CONF_FILE) | 28 | fun netConfFile(netName: String) = File(confDir(netName), NET_CONF_FILE) |
29 | fun invitationFile(netName: String) = File(confDir(netName), NET_INVITATION_FILE) | ||
26 | fun logFile(netName: String) = File(cacheDir(), String.format(LOGFILE_FORMAT, netName)) | 30 | fun logFile(netName: String) = File(cacheDir(), String.format(LOGFILE_FORMAT, netName)) |
27 | fun pidFile(netName: String) = File(App.getContext().cacheDir, String.format(PIDFILE_FORMAT, netName)) | 31 | fun pidFile(netName: String) = File(App.getContext().cacheDir, String.format(PIDFILE_FORMAT, netName)) |
28 | 32 | ||