<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write(self, src, dest=None):
 """Schedules a write of the file at ``src`` to the ``dest`` path in this jar. If the ``src`` is a file, then ``dest`` must be specified. If the ``src`` is a directory then by default all descendant files will be added to the jar as entries carrying their relative path. If ``dest`` is specified it will be prefixed to each descendant's relative path to form its jar entry path. :param string src: the path to the pre-existing source file or directory :param string dest: the path the source file or directory should have in this jar """

    if not src or not isinstance(src, string_types):
      raise ValueError('The src path must be a non-empty string, got {} of type {}.'.format(
        src, type(src)))
    if dest and not isinstance(dest, string_types):
      raise ValueError('The dest entry path must be a non-empty string, got {} of type {}.'.format(
        dest, type(dest)))
    if not os.path.isdir(src) and not dest:
      raise self.Error('Source file {} must have a jar destination specified'.format(src))

    self._add_entry(self.FileSystemEntry(src, dest))