I'll make this private as it's a utility function. I'm happy for the caller to trap the IOException which arises if the file isn't valid later on.