This method gets the extension from the file object. It returns the extension including the period, for example: .cpp.