Added extension method for file.