Skip to content

Commit ba0efff

Browse files
committed
Create databases folder if it does not exist on full update
1 parent 9614074 commit ba0efff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ allprojects {
2424
}
2525

2626
project.ext {
27-
sdkVersion='0.6.5'
27+
sdkVersion='0.6.6'
2828
versionCode=1
2929

3030
compileSdkVersion=27

core/src/main/java/io/snabble/sdk/ProductDatabase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,6 @@ void applyDeltaUpdate(InputStream inputStream) throws IOException {
313313
return;
314314
}
315315

316-
tempDbFile.mkdirs();
317-
318316
FileUtils.copyFile(dbFile, tempDbFile);
319317

320318
SQLiteDatabase tempDb = SQLiteDatabase.openOrCreateDatabase(tempDbFile, null);
@@ -419,6 +417,8 @@ void applyFullUpdate(InputStream inputStream) throws IOException {
419417
return;
420418
}
421419

420+
tempDbFile.getParentFile().mkdirs();
421+
422422
IOUtils.copy(inputStream, new FileOutputStream(tempDbFile));
423423

424424
swap(tempDbFile);

0 commit comments

Comments
 (0)