My recommendation would be to have both:
public static Long getFileSize(String path) {
return getFileSize(new File(path));
}
public static Long getFileSize(File file) {
return (file == null || !file.isFile()) ? 0L : file.length();
}
and let your users choose based on the the kind of object they are using to represent filesystem paths. As @Nikita mentioned, neither choice is wrong.