ExpansionDownloader.Service.DownloaderService.HandleFileUpdated C# (CSharp) Method

HandleFileUpdated() private method

The APK has been updated and a filename has been sent down from the Market call. If the file has the same name as the previous file, we do nothing as the file is guaranteed to be the same. If the file does not have the same name, we download it if it hasn't already been delivered by Market.
private HandleFileUpdated ( string filename, long fileSize ) : bool
filename string /// the name of the new file ///
fileSize long /// the size of the new file ///
return bool
        private bool HandleFileUpdated(string filename, long fileSize)
        {
            DownloadInfo di = DownloadsDatabase.GetDownloadInfo(filename);

            if (di != null && di.FileName != null)
            {
                if (filename == di.FileName)
                {
                    return false;
                }

                // remove partially downloaded file if it is there
                string deleteFile = Helpers.GenerateSaveFileName(this, di.FileName);
                if (File.Exists(deleteFile))
                {
                    File.Delete(deleteFile);
                }
            }

            return !Helpers.DoesFileExist(this, filename, fileSize, true);
        }