def set_file_comment(self, doc, text):
if self.has_package(doc) and self.has_file(doc):<EOL><INDENT>if not self.file_comment_set:<EOL><INDENT>self.file_comment_set = True<EOL>if validations.validate_file_comment(text):<EOL><INDENT>self.file(doc).comment = str_from_text(text)<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>raise SPDXValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise CardinalityError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise OrderError('<STR_LIT>')<EOL><DEDENT>
Raises OrderError if no package or no file defined.
Raises CardinalityError if more than one comment set.
Raises SPDXValueError if text is not free form text.