PurplePen.Updater.FindNonexistantFile C# (CSharp) Method

FindNonexistantFile() private static method

private static FindNonexistantFile ( string downloadedFile ) : string
downloadedFile string
return string
        private static string FindNonexistantFile(string downloadedFile)
        {
            if (!File.Exists(downloadedFile))
                return downloadedFile;
            else {
                string newFile;
                int i = 1;
                do {
                    newFile = Path.Combine(Path.GetDirectoryName(downloadedFile), Path.GetFileNameWithoutExtension(downloadedFile) + "(" + i.ToString() + ")" + Path.GetExtension(downloadedFile));
                    i += 1;
                } while (File.Exists(newFile));
                return newFile;
            }
        }