Allow to have different updates using the same filename

This commit is contained in:
Gabriele M
2017-07-08 21:39:10 +02:00
parent 4979c4d78d
commit 79b44602e0
2 changed files with 25 additions and 0 deletions

View File

@@ -356,6 +356,10 @@ public class UpdaterController implements UpdaterControllerInt {
}
UpdateDownload update = mDownloads.get(downloadId).mUpdate;
File destination = new File(mDownloadRoot, update.getName());
if (destination.exists()) {
destination = Utils.appendSequentialNumber(destination);
Log.d(TAG, "Changing name with " + destination.getName());
}
update.setFile(destination);
DownloadClient downloadClient = new DownloadClient.Builder()
.setUrl(update.getDownloadUrl())