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 | 3 |
1 files changed, 3 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 c745d4d..673faa7 100644 --- a/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt +++ b/app/src/main/java/org/pacien/tincapp/context/AppPaths.kt | |||
@@ -1,6 +1,7 @@ | |||
1 | package org.pacien.tincapp.context | 1 | package org.pacien.tincapp.context |
2 | 2 | ||
3 | import java.io.File | 3 | import java.io.File |
4 | import java.io.FileNotFoundException | ||
4 | 5 | ||
5 | /** | 6 | /** |
6 | * @author pacien | 7 | * @author pacien |
@@ -30,6 +31,8 @@ object AppPaths { | |||
30 | fun logFile(netName: String) = File(cacheDir(), String.format(LOGFILE_FORMAT, netName)) | 31 | fun logFile(netName: String) = File(cacheDir(), String.format(LOGFILE_FORMAT, netName)) |
31 | fun pidFile(netName: String) = File(App.getContext().cacheDir, String.format(PIDFILE_FORMAT, netName)) | 32 | fun pidFile(netName: String) = File(App.getContext().cacheDir, String.format(PIDFILE_FORMAT, netName)) |
32 | 33 | ||
34 | fun existing(f: File) = f.apply { if (!exists()) throw FileNotFoundException(f.absolutePath) } | ||
35 | |||
33 | fun tincd() = File(binDir(), TINCD_BIN) | 36 | fun tincd() = File(binDir(), TINCD_BIN) |
34 | fun tinc() = File(binDir(), TINC_BIN) | 37 | fun tinc() = File(binDir(), TINC_BIN) |
35 | 38 | ||