Returns if all needed remote data files defined in FILES exist locally

@return boolean
761716
private function filesExist()
    {
        foreach (static::FILES as $file) {
            if (!file_exists($this->storage($file))) {
                return false;
            }
        }

        return true;
    }
198537
public function getContainedFiles()
    {
        if ($this->isDir()) {
            $files = array();
            $basePath = rtrim($this->_realpath, DIRECTORY_SEPARATOR);
            foreach (scandir($this->_realpath) as $fileName) {
                if (!in_array($fileName, array('.','..'))) {
                    $files[] = new File($basePath.DIRECTORY_SEPARATOR.$fileName);
                }
            }

            return $files;
        }

        return false;
    }
284082
public function isWritable($remote_file)
    {
        $this->errorHandler->start();

        //remove slashes at beginning and end of dir's, beginning of file
        $dir = substr($this->configuration->getDir(), 0, 1) == '/' ? substr($this->configuration->getDir(), 1) : $this->configuration->getDir();
        $dir = substr($dir, -1, 1) == '/' ? substr($dir, 0, -1) : $dir;
        $remote_file = substr($remote_file, 0, 1) == '/' ? substr($remote_file, 1) : $remote_file;

        //get path info setup properly.
        $dirname = pathinfo('/' . $dir . '/' . $remote_file);
        $dirname = $dirname['dirname'];

        //get a directory listing and check that the file in question is listed (workaround for file_exists)
        $dirlist = $this->driver->nlist($this->resource, $dirname);
        if (is_array($dirlist) && in_array("/$dir/$remote_file", $dirlist)) {
            //file exists, check if we can open the file for appending
            if (!$handle = $this->driver->fopen($dir . '/' . $remote_file, 'a', $this->configuration)) {
                $this->errorHandler->stop();

                return false;
            }

            //attempt to do an empty append
            if (!fwrite($handle, '') === FALSE) {
                $this->errorHandler->stop();

                return false;
            }
            $this->errorHandler->stop();

            return true;
        }

        //file not found, return false
        $this->errorHandler->stop();

        return false;
    }
1327333
def exists(self, filepath):
        """"""
        if self.is_ssh(filepath):
            self._check_ftp()
            remotepath = self._get_remote(filepath)
            try:
                self.ftp.stat(remotepath)
            except IOError as e:
                if e.errno == errno.ENOENT:
                    return False
            else:
                return True
        else:
            return os.path.exists(filepath)
590392
public function exists(): bool
    {
        $key = $this->getStorageKey();

        return $key && $this->getFlexDirectory()->getStorage()->hasKey($key);
    }
1015697
private function isLocalIp ()
    {
        $ip = $this->serverData["REMOTE_ADDR"];

        if (!is_string($ip))
        {
            return false;
        }

        if (in_array($ip, ['127.0.0.1', 'fe80::1', '::1'], true))
        {
            return true;
        }

        // allowed (= local) IPs include
        // 10.0.0.0 – 10.255.255.255
        // 172.16.0.0 – 172.31.255.255
        // 192.168.0.0 – 192.168.255.255
        return 1 === preg_match("/^(10\\.|192\\.168\\.|172\\.(1[6-9]|2[0-9]|3[0-1])\\.)/", $ip);
    }
428474
private function isLocalFile()
    {
        try {
            if (file_exists(storage_path('app/'.$this->location))) {
                return true;
            }
        } catch (Exception $e) {
            Log::debug('Could not find the image');

            return false;
        }

        return false;
    }
864497
private function checkDatabaseFile()
    {
        if ($this->isDatabaseExists()) return;

        $pathinfo = pathinfo($path = $this->getDatabasePath());

        if ( ! file_exists($pathinfo['dirname'])) {
            mkdir($pathinfo['dirname'], 0777, true);
        }

        copy(realpath(__DIR__ . '/../../data/geoip.mmdb'), $path);
    }
634707
def checkIfRemoteIsNewer(self, localfile):
        
        is_remote_newer = False
        if localfile.exists() and localfile.stat().st_size > 0:
            LOG.info("File exists locally, using cache")
        else:
            is_remote_newer = True
            LOG.info("No cache file, fetching entries")
        return is_remote_newer
1073260
def check_file_exists(self, remote_cmd="dir home"):
        """"""
        if self.direction == "put":
            remote_out = self.ssh_ctl_chan.send_command_expect(remote_cmd)
            search_string = r"Directory contents .*{}".format(self.dest_file)
            return bool(re.search(search_string, remote_out, flags=re.DOTALL))
        elif self.direction == "get":
            return os.path.exists(self.dest_file)
631318
public function valid() {
        if (!isset($this->za)) {
            return false;
        }

        // Skip over unwanted system files (get_info will return false).
        while (!$this->get_info($this->pos) && $this->pos < $this->za->numFiles) {
            $this->next();
        }

        // No files left - we're at the end.
        if ($this->pos >= $this->za->numFiles) {
            return false;
        }

        return true;
    }
624204
public function checkFileUploads()
    {
        $dUploadFile = -1;
        $sFileUploads = @ini_get('file_uploads');
        if ($sFileUploads !== false) {
            if ($sFileUploads && ($sFileUploads == '1' || strtolower($sFileUploads) == 'on')) {
                $dUploadFile = 2;
            } else {
                $dUploadFile = 1;
            }
        }

        return $dUploadFile;
    }
746651
public static function Exists($Files) {
      if (!is_array($Files))
         $Files = array($Files);

      $Return = FALSE;
      $Count = count($Files);
      for ($i = 0; $i < $Count; ++$i) {
         if (file_exists($Files[$i])) {
            $Return = $Files[$i];
            break;
         }
      }

      return $Return;
   }
857385
public function isValidLocalPath()
    {
        //====================================================================//
        // Verify no result in Cache
        if (!isset($this->ValidLocalPath)) {
            $path = Splash::getLocalPath();
            //====================================================================//
            // Verify Local Path Exist
            if (is_null($path) || !is_dir($path)) {
                $this->ValidLocalPath = false;

                return Splash::log()->err(Splash::trans('ErrLocalPath', (string) $path));
            }

            $this->ValidLocalPath = true;
        }

        return $this->ValidLocalPath;
    }
966454
protected function fileExistsAndReadable ()
	{
		if ($this->isDataStream === true)
		{
			return;
		}
		
		if (stristr($this->fileName, 'http://') !== false)
		{
			$this->remoteImage = true;
			return;
		}
		
		if (!file_exists($this->fileName))
		{
			$this->triggerError('Image file not found: ' . $this->fileName);
		}
		elseif (!is_readable($this->fileName))
		{
			$this->triggerError('Image file not readable: ' . $this->fileName);
		}
	}
498569
protected function retrieveFiles()
    {
        $localFiles = [];

        $pattern   = $this->getFilePattern();
        $localPath = rtrim($this->request->getLocalPath(), DIRECTORY_SEPARATOR);
        $callback  = $this->request->getFilesCallback();

        // get local files based on given path and pattern
        $files = $this->files->files($localPath);

        if ($callback instanceof Closure) {
            $files = $callback($files);
        }

        foreach ($files as $file) {

            // File::files returns full pathname to file, so get basename
            $filename = basename($file);

            if ( ! empty($pattern) && ! fnmatch($pattern, $filename)) continue;

            $localFiles[ $filename ] = $file;
        }


        if ( ! count($localFiles)) {

            throw new EmptyRetrievedDataException(
                "No local files read for pattern '{$this->getFilePattern()}' for path: '{$localPath}'."
            );
        }

        return $localFiles;
    }
517069
public function hasFile(string $name) : bool
    {
        return $this->fileContentAreas->any(function (FileContentArea $contentArea) use ($name) {
            return $contentArea->name === $name;
        });
    }