Check the folder exists.

@param  string  $path

@return bool
504666
private function isFolderExists($path)
    {
        return $this->filesystem->exists($path) && $this->filesystem->isDirectory($path);
    }
466022
public static function isFile($path): bool
    {
        $path = self::clean($path);
        return file_exists($path) && is_file($path);
    }
216653
public function isFile($path)
    {
        $metadata = $this->dropbox->getMetadata($this->pathRoot.$path);
        return is_array($metadata) && isset($metadata['is_dir']) && $metadata['is_dir']==false;
    }
1276731
public function has(string $path)
    {
        [$prefix, $path] = $this->getPrefixAndPath($path);

        return $this->getFilesystem($prefix)->has($path);
    }
771691
public function isdir(string $path): Promise
    {
        if (!@\file_exists($path)) {
            return new Success(false);
        }

        $isDir = @\is_dir($path);
        \clearstatcache(true, $path);

        return new Success($isDir);
    }
397335
public function exists($path)
  {
    $name = null;
    $subtree = $this->subtree($path, $name);

    return !is_null($subtree) && isset($subtree->_ownData[$name]);
  }
45749
private function verify(string $path)
  {
    if (!is_dir($this->cacheDirectory))
      mkdir($this->cacheDirectory, 0777, true);

      if (!is_dir($this->cacheDirectory)) {
        return $this->exception(
          'Caching directory "' . $this->cacheDirectory . '" does not exist.'
        );
      }

    if (!is_dir($this->viewsDirectory))
      return $this->exception(
        'Views directory "' . $this->viewsDirectory . '" does not exist.'
      );

    if (!file_exists($path))
      return $this->exception(
        'View file "' . $path . '" does not exist.'
      );
  }
1151546
public function has($path)
    {
        $x = $this->xpath($path);

        return count($x) ? true : false;
    }
554635
public function fileExists($path)
    {
        $filePath = $this->getFullPath($path);

        return file_exists($filePath) ? true : false;
    }
1027964
public function have($path)
    {
        $keys  = $this->explode($path);
        $array = $this->values;
        foreach ($keys as $key) {
            if (isset($array[$key])) {
                $array = $array[$key];
            } else {
                return false;
            }
        }

        return true;
    }
1253453
protected function isWithinFilesystem($path)
    {
        $pathUrl = new Url($path);
        $fsUrl = $this->filesystem->url();

        if (!$pathUrl->scheme) {
            $pathUrl = $pathUrl->scheme('file');
        }

        if (!$fsUrl->scheme) {
            $fsUrl = $fsUrl->scheme('file');
        }

        if ($pathUrl->scheme != $fsUrl->scheme) {
            return false;
        }

        if (Helper::startsWith("$pathUrl->path", "$fsUrl->path")) {
            return true;
        }

        return $this->filesystem->exists($path);
    }
26396
public function has($path)
    {
        $path = $this->applyPathPrefix($path);
        $object = $this->bucket->object($path);

        return $object->exists();
    }
299539
final public static function checkFileLogExist(string $path):bool
    {
        if (!file_exists($path)) {
            return ((file_put_contents($path, "") != false)? true : false);
        }

        if (!is_readable($path)) {
            return (false);
        }

        if (!is_writable($path)) {
            return (false);
        }
        return (true);
    }
1150756
public static function checkPath($path)
    {
        if (!is_string($path)) {
            throw new InvalidArgumentException(sprintf("String expected as path, got '%s' instead", gettype($path)));
        }
        if (!file_exists($path)) {
            throw new InvalidArgumentException(sprintf("'%s' does not exist", $path));
        }

        if (!is_dir($path)) {
            throw new InvalidArgumentException(sprintf("'%s' is not a directory", $path));
        }

        if (!is_readable($path)) {
            throw new InvalidArgumentException(sprintf("'%s' is not readable", $path));
        }

        return true;
    }
89666
public function has($path)
    {
        $location = $this->applyPathPrefix($path);

        if ($this->s3Client->doesObjectExist($this->bucket, $location, $this->options)) {
            return true;
        }

        return $this->doesDirectoryExist($location);
    }
1331568
public function pathExists(string $path): bool
	{
		$loader = $this->getRenderer()->getLoader();

		/*
		 * For Twig 1.x compatibility, check if the loader implements ExistsLoaderInterface
		 * As of Twig 2.0, the `exists()` method is part of LoaderInterface
		 * This conditional may be removed when dropping Twig 1.x support
		 */
		if ($loader instanceof ExistsLoaderInterface || method_exists(LoaderInterface::class, 'exists'))
		{
			return $loader->exists($path);
		}

		// For all other cases we'll assume the path exists
		return true;
	}
1161298
protected function checkPath($path)
    {
        if (is_dir($path)) {
            return true;
        }
        if (mkdir($path, 0755, true)) {
            return true;
        } else {
            return false;
        }
    }