Make deleting Site Extensions more robust to locked directories and files

I tested by installing and uninstalling phpMyAdmin. Previously uninstallation would fail when the directory is locked.
is there a reason to call this GetRepositoryFile?  Could it be confusing with Repository like in Git/Hg?  Another idea is to call it GetNugetPackageFile().