If you pass the string, you have control in the method over how the file is opened, and the file handle managed. You are centralising that code. If you pass the File
object, then you are duplicating the file handling code everywhere this is called. So I'd have a strong preference for the former.