summaryrefslogtreecommitdiffstats
path: root/updater_sample/tests/src
diff options
context:
space:
mode:
authorZhomart Mukhamejanov <zhomart@google.com>2018-05-03 20:03:14 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-05-03 20:03:14 +0200
commitd3df835f3f01cfe08257e81d51349931ff185f21 (patch)
tree70415709b602555457438bb5f2e7692ec5910073 /updater_sample/tests/src
parentMerge "screen_ui: Merge Menu::Start() into its ctor." am: 0cabcd0126 (diff)
parentMerge "updater_sample: update ui and README, clean-up" (diff)
downloadandroid_bootable_recovery-d3df835f3f01cfe08257e81d51349931ff185f21.tar
android_bootable_recovery-d3df835f3f01cfe08257e81d51349931ff185f21.tar.gz
android_bootable_recovery-d3df835f3f01cfe08257e81d51349931ff185f21.tar.bz2
android_bootable_recovery-d3df835f3f01cfe08257e81d51349931ff185f21.tar.lz
android_bootable_recovery-d3df835f3f01cfe08257e81d51349931ff185f21.tar.xz
android_bootable_recovery-d3df835f3f01cfe08257e81d51349931ff185f21.tar.zst
android_bootable_recovery-d3df835f3f01cfe08257e81d51349931ff185f21.zip
Diffstat (limited to 'updater_sample/tests/src')
-rw-r--r--updater_sample/tests/src/com/example/android/systemupdatersample/util/FileDownloaderTest.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/updater_sample/tests/src/com/example/android/systemupdatersample/util/FileDownloaderTest.java b/updater_sample/tests/src/com/example/android/systemupdatersample/util/FileDownloaderTest.java
index dc7ec09e1..80506ee6d 100644
--- a/updater_sample/tests/src/com/example/android/systemupdatersample/util/FileDownloaderTest.java
+++ b/updater_sample/tests/src/com/example/android/systemupdatersample/util/FileDownloaderTest.java
@@ -60,7 +60,7 @@ public class FileDownloaderTest {
File packageFile = Paths
.get(mTargetContext.getCacheDir().getAbsolutePath(), "ota.zip")
.toFile();
- Files.delete(packageFile.toPath());
+ Files.deleteIfExists(packageFile.toPath());
Files.copy(mTestContext.getResources().openRawResource(R.raw.ota_002_package),
packageFile.toPath());
String url = "file://" + packageFile.getAbsolutePath();
@@ -68,7 +68,7 @@ public class FileDownloaderTest {
File outFile = Paths
.get(mTargetContext.getCacheDir().getAbsolutePath(), "care_map.txt")
.toFile();
- Files.delete(outFile.toPath());
+ Files.deleteIfExists(outFile.toPath());
// download a chunk of ota.zip
FileDownloader downloader = new FileDownloader(url, 160, 8, outFile);
downloader.download();