Resume download from new URL
Hi, Is there anyway to resume download from new urls if i paused the download. My download url is dynamically generated and each for one time use only, if I paused a download at a certain point and resumed then a new url is generated for the same file. Basically the file is same but want to use different urls if I paused one. Any help??
FileDownloader didn't support your case yet because FileDownloader generates the task identify through the md5 from the path and the Url, Sorry about that.
But I will support that as soon as possible, you can follow this issue: #224
Thanks for your replay. What if I removed url from the following function in the lib
public static int generateId(final String url, final String path, final boolean pathAsDirectory) {
if (pathAsDirectory) {
return md5(formatString("%sp%s@dir", url, path)).hashCode();
} else {
return md5(formatString("%sp%s", url, path)).hashCode();
}
}
and replaced with filename or something. Will it work then??
Yes, If you don't care about the compatible for some old data(what doesn't complete download yet(maybe status is paused)) have been stored in the database before the code has been deployed, this is the simplest way to match you want.
Okay. I'll try it.
ok
There is another thing, I think you know, In this way, because of the URL no longer the mater. so whatever Url you used to download, once the path and pathAsDirectory you provided is the same, they will be treated as the same tasks.
What if I put some unique ids there like filename or something.
Yes, I think that would be better.