<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getfilearchive(self, project_id, filepath=None):
 """ Get an archive of the repository :param project_id: project id :param filepath: path to save the file to :return: True if the file was saved to the filepath """

        if not filepath:
            filepath = ''

        request = requests.get(
            '{0}/{1}/repository/archive'.format(self.projects_url, project_id),
            verify=self.verify_ssl, auth=self.auth, headers=self.headers, timeout=self.timeout)

        if request.status_code == 200:
            if filepath == "":
                filepath = request.headers['content-disposition'].split(';')[1].split('=')[1].strip('"')
            with open(filepath, 'wb') as filesave:
                filesave.write(request.content)
                # TODO: Catch oserror exceptions as no permissions and such
                # TODO: change the filepath to a path and keep always the filename?
            return True
        else:
            msg = request.json()['message']
            raise exceptions.HttpError(msg)