Move validations to the File class