Determines if a file entry for a path specification exists.

    Args:
      path_spec (PathSpec): a path specification.

    Returns:
      bool: True if the file entry exists.
176774
def FileEntryExistsByPathSpec(self, path_spec):
    
    volume_index = apfs_helper.APFSContainerPathSpecGetVolumeIndex(path_spec)

    # The virtual root file has not corresponding volume index but
    # should have a location.
    if volume_index is None:
      location = getattr(path_spec, 'location', None)
      return location is not None and location == self.LOCATION_ROOT

    return 0 <= volume_index < self._fsapfs_container.number_of_volumes
127921
def exists(self, path, **kwargs):
        """"""
        try:
            self.get_file_status(path, **kwargs)
            return True
        except HdfsFileNotFoundException:
            return False
867476
def fileExists(fName, dire=pDir()):
    
    if os.path.isfile(os.path.join(dire, fName)):
        return True
    return False
1352440
def exists(self, path):
        
        import hdfs
        try:
            self.client.status(path)
            return True
        except hdfs.util.HdfsError as e:
            if str(e).startswith('File does not exist: '):
                return False
            else:
                raise e
619274
private boolean exists(FTPClient client, Path file) {
    try {
      return getFileStatus(client, file) != null;
    } catch (FileNotFoundException fnfe) {
      return false;
    } catch (IOException ioe) {
      throw new FTPException("Failed to get file status", ioe);
    }
  }
1004902
def check_exists(path, type='file'):
    

    if type == 'file':
        if not os.path.isfile(path):
            raise RuntimeError('The file `%s` does not exist.' % path)
    else:
        if not os.path.isdir(path):
            raise RuntimeError('The folder `%s` does not exist.' % path)

    return True
589016
def GetFileEntryByPathSpec(self, path_spec):
    
    # Opening a file by MFT entry is faster than opening a file by location.
    # However we need the index of the corresponding $FILE_NAME MFT attribute.
    fsntfs_file_entry = None
    location = getattr(path_spec, 'location', None)
    mft_attribute = getattr(path_spec, 'mft_attribute', None)
    mft_entry = getattr(path_spec, 'mft_entry', None)

    if (location == self.LOCATION_ROOT or
        mft_entry == self.MFT_ENTRY_ROOT_DIRECTORY):
      fsntfs_file_entry = self._fsntfs_volume.get_root_directory()
      return ntfs_file_entry.NTFSFileEntry(
          self._resolver_context, self, path_spec,
          fsntfs_file_entry=fsntfs_file_entry, is_root=True)

    try:
      if mft_attribute is not None and mft_entry is not None:
        fsntfs_file_entry = self._fsntfs_volume.get_file_entry(mft_entry)
      elif location is not None:
        fsntfs_file_entry = self._fsntfs_volume.get_file_entry_by_path(location)

    except IOError as exception:
      raise errors.BackEndError(exception)

    if fsntfs_file_entry is None:
      return None

    return ntfs_file_entry.NTFSFileEntry(
        self._resolver_context, self, path_spec,
        fsntfs_file_entry=fsntfs_file_entry)
1254266
def check_file_path(self, path):
        
        if os.path.exists(path) is not True:
            msg = "File Not Found {}".format(path)
            raise OSError(msg)
66225
def GetFileEntryByPathSpec(self, path_spec):
    
    return data_range_file_entry.DataRangeFileEntry(
        self._resolver_context, self, path_spec, is_root=True, is_virtual=True)
1128681
def GetFileEntryByPathSpec(self, path_spec):
    
    return fvde_file_entry.FVDEFileEntry(
        self._resolver_context, self, path_spec, is_root=True, is_virtual=True)
981671
def check_path(path, credentials=None):
    
    from thunder.readers import get_file_reader
    reader = get_file_reader(path)(credentials=credentials)
    existing = reader.list(path, directories=True)
    if existing:
        raise ValueError('Path %s appears to already exist. Specify a new directory, '
                         'or call with overwrite=True to overwrite.' % path)
329478
def FileEntryExistsByPathSpec(self, path_spec):
    
    location = getattr(path_spec, 'location', None)
    if location is None or not location.startswith(self.LOCATION_ROOT):
      return False

    if len(location) == 1:
      return True

    return self._cpio_archive_file.FileEntryExistsByPath(location[1:])
1130275
def FileEntryExistsByPathSpec(self, path_spec):
    
    tsk_vs_part, _ = tsk_partition.GetTSKVsPartByPathSpec(
        self._tsk_volume, path_spec)

    # The virtual root file has not corresponding TSK volume system part object
    # but should have a location.
    if tsk_vs_part is None:
      location = getattr(path_spec, 'location', None)
      return location is not None and location == self.LOCATION_ROOT

    return True
90291
def GetFileEntryByPathSpec(self, path_spec):
    
    if not self.FileEntryExistsByPathSpec(path_spec):
      return None
    return os_file_entry.OSFileEntry(self._resolver_context, self, path_spec)
872281
def _file_exists(path, filename):
  """"""
  return os.path.isfile(os.path.join(path, filename))
417608
def is_file(self):
        
        if not isinstance(self.host_list, basestring):
            return False
        return os.path.exists(self.host_list)
1277831
def GetFileEntryByPathSpec(self, path_spec):
    
    return compressed_stream_file_entry.CompressedStreamFileEntry(
        self._resolver_context, self, path_spec, is_root=True, is_virtual=True)