Easily rename files in place. This is needed because Windows errors on rename if a file already exists. Please see this commit, from which the code is extracted: https://github.com/lvarvel/cacheddownloader/commit/505a1fd
The original author of this code are "David Morhovich, David Varvel and John Shahid" (see this commit)
The code originally comes from https://github.com/lvarvel/cacheddownloader, which is licensed Apache 2.0.