Move the file-related helper methods to a FileUtils class.