| 1368 | } |
| 1369 | |
| 1370 | void ScriptingObjects::ScriptDownloadObject::flushTemporaryFile() |
| 1371 | { |
| 1372 | if (resumeFile.existsAsFile()) |
| 1373 | { |
| 1374 | ScopedPointer<FileInputStream> fis = new FileInputStream(resumeFile); |
| 1375 | FileOutputStream fos(targetFile); |
| 1376 | |
| 1377 | auto numWritten = fos.writeFromInputStream(*fis, -1); |
| 1378 | |
| 1379 | ignoreUnused(numWritten); |
| 1380 | |
| 1381 | fos.flush(); |
| 1382 | fis = nullptr; |
| 1383 | |
| 1384 | download = nullptr; |
| 1385 | auto ok = resumeFile.deleteFile(); |
| 1386 | |
| 1387 | if(ok) |
| 1388 | resumeFile = File(); |
| 1389 | } |
| 1390 | } |
| 1391 | |
| 1392 | void ScriptingObjects::ScriptDownloadObject::progress(URL::DownloadTask*, int64 bytesDownloaded, int64 totalLength) |
| 1393 | { |
no test coverage detected