This project has moved and is read-only. For the latest updates, please go here.

Directory and all downloaded files deleted on first error


If a file fails to download (404 for instance), its directory will be deleted - even if there are other files in there that have already been downloaded (as is normally the case).
The following change is what causes the problem:
If you look at line 282, it will delete the directory if a download files - however that directory may have already existed before the file was attempted to be downloaded (line 264), so contains files which will now be erroneously deleted.
The fix is to delete the else clause of line 264 and wrap the check on line 282 in a check for createdDirectory being non-null.