Renaming file to a nonexisting file on Windows

The method fails in case the file does not exists before renaming. canonical.delete() returns false in that case and the method throws an exception.