diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/context/AppPaths.kt')
-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 | ||