Skip to content
Snippets Groups Projects
Unverified Commit 007adb1b authored by Jakob Möller's avatar Jakob Möller Committed by GitHub
Browse files

Correct File Storage to internal, fixes #6 (#218)


Signed-off-by: default avatard067928 <jakob.moeller@sap.com>
parent 60755b77
No related branches found
No related tags found
No related merge requests found
......@@ -27,12 +27,10 @@ object FileStorageHelper {
* Get key files export directory used to store all export files for the transaction
* Uses FileStorageConstants.KEY_EXPORT_DIRECTORY_NAME constant
*
* TODO Change to CacheDir before release
*
* @return File of key export directory
*/
val keyExportDirectory = File(
CoronaWarnApplication.getAppContext().getExternalFilesDir(null),
CoronaWarnApplication.getAppContext().cacheDir,
FileStorageConstants.KEY_EXPORT_DIRECTORY_NAME
)
......
......@@ -59,7 +59,8 @@ class KeyCacheRepository(private val keyCacheDao: KeyCacheDao) {
)
suspend fun deleteOutdatedEntries() = keyCacheDao.getAllEntries().forEach {
if (File(it.path).isOutdated()) {
val file = File(it.path)
if (file.isOutdated() || !file.exists()) {
deleteFileForEntry(it)
keyCacheDao.deleteEntry(it)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment