code: def GetFileEntryByPathSpec(self, path_spec):
      
      if not self.FileEntryExistsByPathSpec(path_spec):
        return None
  
      location = getattr(path_spec, 'location', None)
  
      if len(location) == 1:
        return zip_file_entry.ZipFileEntry(
            self._resolver_context, self, path_spec, is_root=True,
            is_virtual=True)
  
      kwargs = {}
      try:
        kwargs['zip_info'] = self._zip_file.getinfo(location[1:])
      except KeyError:
        kwargs['is_virtual'] = True
  
      return zip_file_entry.ZipFileEntry(
          self._resolver_context, self, path_spec, **kwargs)
docs: Retrieves a file entry for a path specification.
  
      Args:
        path_spec (PathSpec): path specification of the file entry.
  
      Returns:
        ZipFileEntry: a file entry or None.