

def GetFileEntryByPathSpec(self, path_spec):
    'Retrieves a file entry for a path specification.\n\n    Args:\n      path_spec: a path specification (instance of PathSpec).\n\n    Returns:\n      A file entry (instance of vfs.TARFileEntry) or None.\n    '
    tar_info = None
    location = getattr(path_spec, 'location', None)
    if ((location is None) or (not location.startswith(self.LOCATION_ROOT))):
        return
    if (len(location) == 1):
        return dfvfs.vfs.tar_file_entry.TARFileEntry(self._resolver_context, self, path_spec, is_root=True, is_virtual=True)
    try:
        tar_info = self._tar_file.getmember(location[1:])
    except KeyError:
        pass
    if (tar_info is None):
        return
    return dfvfs.vfs.tar_file_entry.TARFileEntry(self._resolver_context, self, path_spec, tar_info=tar_info)

dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/vfs/tar_file_system.py TARFileSystem.GetFileEntryByPathSpec/original