CSC510207. Using SPWeb.GetFile method is preferable.
Use the SPWeb.GetFile method instead of SPFolder.Files["WordTemplate.docx"]. Because SPFolder.Files will fail with an ArgumentException if the file does not exist. Besides, performance issues with SPFolder.Files - it loads all files in the target
SPWeb.GetFile method always returns an object. If the file does not exist, the method returns an SPFile object whose Exists property is set to false.
There are still circumstances in which GetFile could return null. Hence, a helper method is desirable if you have many such file operations.
static SPFile GetExistingFile(SPWeb web, string serverRelativeUrl)
SPFile file = null;
bool exists = false;
file = web.GetFile(serverRelativeUrl);
if (file != null)
exists = file.Exists;
exists = false;