Returns whether the file at the given location exists

@param string $zipStreamURI URI of a zip stream, e.g. "zip://file.zip#path/inside.xml"
@return bool TRUE if the file exists, FALSE otherwise
423905
protected function fileExistsWithinZip($zipStreamURI)
    {
        $doesFileExists = false;

        $pattern = '/zip:\/\/([^#]+)#(.*)/';
        if (preg_match($pattern, $zipStreamURI, $matches)) {
            $zipFilePath = $matches[1];
            $innerFilePath = $matches[2];

            $zip = new \ZipArchive();
            if ($zip->open($zipFilePath) === true) {
                $doesFileExists = ($zip->locateName($innerFilePath) !== false);
                $zip->close();
            }
        }

        return $doesFileExists;
    }
509608
protected function hasValidCacheEntry($uri): bool
    {
        $entry = $this->cache->get($uri);

        return false !== $entry &&
            empty($entry['explanation']) &&
            $entry['expires'] >= (new DateTimeService())->getCurrentTime();
    }
34738
public function hasEndpoint($uri)
    {
        /** @var ArrayCollection $urlsFound */
        $urlsFound = $this->getEndpoints()->filter(function (Endpoint $endpoint) use ($uri) {
            // return when URI and URI string are equal
            return (string) $endpoint->getUri() === $uri;
        });

        return $urlsFound->isEmpty() === false;
    }
68112
public boolean exists() {
		// Try file existence: can we find the file in the file system?
		try {
			return getFile().exists();
		}
		catch (IOException ex) {
			// Fall back to stream existence: can we open the stream?
			try {
				InputStream is = getInputStream();
				is.close();
				return true;
			}
			catch (Throwable isEx) {
				return false;
			}
		}
	}
1266452
function exists()
    {
        $path = $this->PHPDir . '/' . $this->PHPFile;
        if ( !$this->ClusteringEnabled )
            return file_exists( $path );

        if ( !$this->ClusterHandler )
        {
            $this->ClusterHandler = eZClusterFileHandler::instance();
        }
        return $this->ClusterHandler->fileExists( $path );
    }
1359749
public function findCachedFile( $url )
	{
		if ( ! $this->useCache ) return false;

		$path = str_replace( '//', '/', XBRL_Global::createPathFromUrl( $url, $this->cacheLocation ) );

		return file_exists( $path )
			? $path
			: false;
	}
927913
public static function containsExtension(string $uri): string
    {
        $pathParts     = explode('/', $uri);
        $filename      = array_pop($pathParts);
        $filenameParts = explode('.', $filename);

        if (count($filenameParts) > 1) {
            return array_pop($filenameParts);
        }

        return '';
    }
462787
public static function isUri($strarg)
    {
        $returnValue = (bool) false;
        $uri = trim($strarg);
        if(!empty($uri)){
        	if( (preg_match("/^(http|https|file|ftp):\/\/[\/:.A-Za-z0-9_-]+#[A-Za-z0-9_-]+$/", $uri) && strpos($uri,'#')>0) || strpos($uri,"#")===0){
        		$returnValue = true;
        	}
        }
        return (bool) $returnValue;
    }
1345443
protected function isBlacklisted($uri)
    {
        $uri = $this->normalizePath($uri);

        foreach (static::$configuration->getBlackList() as $path) {
            if (strpos($uri, $path) !== false) {
                return true;
            }
        }

        return false;
    }
1247015
public static function validateURI($uri) {
        if(!empty(trim($uri))){
            return filter_var(trim($uri), FILTER_VALIDATE_URL);
        }
        return false;
    }
1195335
public function fileExists($file)
    {
        return ($this->isConnected() === true) ? ftp_rmdir($this->connectionString.$file) : false;
    }
365383
public static boolean isZipFile(File zipFile) {
    try {
      ZipFile zf = new ZipFile(zipFile);
      boolean isZip = zf.getEntries().hasMoreElements();
      zf.close();
      return isZip;
    } catch (IOException e) {
      return false;
    }
  }
1044066
public function fileExists()
    {
        $this->filenameIsValide($this->name);

        return file_exists($this->getPath()) || is_dir($this->base_dir."/".$this->name);
    }
1202057
public static function isValid($httpUri): bool
    {
        if ($httpUri instanceof self) {
            return true;
        }

        if (empty($httpUri) || !is_string($httpUri)) {
            return false;
        }

        try {
            self::fromString($httpUri);
        } catch (MalformedUri $murle) {
            return false;
        }

        return true;
    }
857434
public static function unzip( $zipfile ) {
        $zip = zip_open( $zipfile );
        if( !is_resource( $zip ) )
            return false;
        $data = false;
        $zip_entry = zip_read( $zip );
        if (!$zip_entry) {
            return false;
        }
        if( zip_entry_open( $zip, $zip_entry, 'r' ) ) {
            $data = zip_entry_read( $zip_entry, zip_entry_filesize( $zip_entry ) );
            zip_entry_close( $zip_entry );
        }
        zip_close( $zip );
        return $data;
    }
1128416
public static function exists(string $path) : bool
    {
        try {
            return ErrorCatcher::run(static function() use ($path) {
                return file_exists($path);
            });
        } catch (\ErrorException $e) {
            throw new IoException('Error checking if ' . $path . ' exists', 0, $e);
        }
    }
68887
public function exists($files)
    {
        $maxPathLength = PHP_MAXPATHLEN - 2;

        foreach ($this->toIterable($files) as $file) {
            if (strlen($file) > $maxPathLength) {
                throw new IOException(sprintf('Could not check if file exist because path length exceeds %d characters.', $maxPathLength), 0, null, $file);
            }

            if (!file_exists($file)) {
                return false;
            }
        }

        return true;
    }