def __init__(
      self, resolver_context, file_system, path_spec, is_root=False,
      is_virtual=False, zip_info=None):
    """Initializes a file entry.

    Args:
      resolver_context (Context): resolver context.
      file_system (FileSystem): file system.
      path_spec (PathSpec): path specification.
      is_root (Optional[bool]): True if the file entry is the root file entry
          of the corresponding file system.
      is_virtual (Optional[bool]): True if the file entry is a virtual file
          entry emulated by the corresponding file system.
      zip_info (Optional[zipfile.ZipInfo]): ZIP information.

    Raises:
      BackEndError: when the zip info is missing in a non-virtual file entry.
    """
    if not is_virtual and zip_info is None:
      zip_info = file_system.GetZipInfoByPathSpec(path_spec)
    if not is_virtual and zip_info is None:
      raise errors.BackEndError('Missing zip info in non-virtual file entry.')

    super(ZipFileEntry, self).__init__(
        resolver_context, file_system, path_spec, is_root=is_root,
        is_virtual=is_virtual)
    self._creator_system = getattr(zip_info, 'create_system', 0)
    self._external_attributes = getattr(zip_info, 'external_attr', 0)
    self._zip_info = zip_info

    if (is_virtual or
        self._external_attributes & self._MSDOS_FILE_ATTRIBUTES_IS_DIRECTORY):
      self.entry_type = definitions.FILE_ENTRY_TYPE_DIRECTORY
    else:
      self.entry_type = definitions.FILE_ENTRY_TYPE_FILE
def __init__ ( self , resolver_context , file_system , path_spec , is_root = False , is_virtual = False , zip_info = None ) : if not is_virtual and zip_info is None : zip_info = file_system . GetZipInfoByPathSpec ( path_spec ) if not is_virtual and zip_info is None : raise errors . BackEndError ( 'Missing zip info in non-virtual file entry.' ) super ( ZipFileEntry , self ) . __init__ ( resolver_context , file_system , path_spec , is_root = is_root , is_virtual = is_virtual ) self . _creator_system = getattr ( zip_info , 'create_system' , 0 ) self . _external_attributes = getattr ( zip_info , 'external_attr' , 0 ) self . _zip_info = zip_info if ( is_virtual or self . _external_attributes & self . _MSDOS_FILE_ATTRIBUTES_IS_DIRECTORY ) : self . entry_type = definitions . FILE_ENTRY_TYPE_DIRECTORY else : self . entry_type = definitions . FILE_ENTRY_TYPE_FILE
Initializes a file entry.

    Args:
      resolver_context (Context): resolver context.
      file_system (FileSystem): file system.
      path_spec (PathSpec): path specification.
      is_root (Optional[bool]): True if the file entry is the root file entry
          of the corresponding file system.
      is_virtual (Optional[bool]): True if the file entry is a virtual file
          entry emulated by the corresponding file system.
      zip_info (Optional[zipfile.ZipInfo]): ZIP information.

    Raises:
      BackEndError: when the zip info is missing in a non-virtual file entry.