Here's an example of a utility method:
public static Long getFileSize(String fileString) {
File file = new File(fileString);
if (file == null || !file.isFile())
return null;
return file.length();
}
Is it a good practise to pass a String rather than a File to a method like this? In general what reasoning should be applied when making utility methods of this style?