mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-02 17:55:42 +00:00
ROOM temp dir
This commit is contained in:
parent
715dd2c36a
commit
aaafe78bef
2 changed files with 3 additions and 3 deletions
|
@ -206,8 +206,8 @@ class SQLiteCopyOpenHelper implements SupportSQLiteOpenHelper, DelegatingOpenHel
|
||||||
|
|
||||||
// An intermediate file is used so that we never end up with a half-copied database file
|
// An intermediate file is used so that we never end up with a half-copied database file
|
||||||
// in the internal directory.
|
// in the internal directory.
|
||||||
File intermediateFile = File.createTempFile(
|
File dir = eu.faircode.email.Helper.ensureExists(new File(mContext.getFilesDir(), "shared"));
|
||||||
"room-copy-helper", ".tmp", mContext.getCacheDir());
|
File intermediateFile = new File(dir,"room-copy-helper.tmp");
|
||||||
intermediateFile.deleteOnExit();
|
intermediateFile.deleteOnExit();
|
||||||
FileChannel output = new FileOutputStream(intermediateFile).getChannel();
|
FileChannel output = new FileOutputStream(intermediateFile).getChannel();
|
||||||
FileUtil.copy(input, output);
|
FileUtil.copy(input, output);
|
||||||
|
|
|
@ -2633,7 +2633,7 @@ public class Helper {
|
||||||
|
|
||||||
private static final Map<File, Boolean> exists = new HashMap<>();
|
private static final Map<File, Boolean> exists = new HashMap<>();
|
||||||
|
|
||||||
static File ensureExists(File dir) {
|
public static File ensureExists(File dir) {
|
||||||
synchronized (exists) {
|
synchronized (exists) {
|
||||||
if (exists.containsKey(dir))
|
if (exists.containsKey(dir))
|
||||||
return dir;
|
return dir;
|
||||||
|
|
Loading…
Reference in a new issue