Returns TRUE if a file or directory is empty and FALSE if not.

@param  string $path Path to directory
@return bool
3278
public function isEmpty(string $path): bool
	{
		if(is_dir($path))
		{
			return (new FilesystemIterator($path))->valid() === false;
		}

		return filesize($path) === 0;
	}
793260
public function isValidPath($path)
    {
        $isValidPath = false;

        $pathValue = $this->getValueByPath($path);
        if (!is_null($pathValue)) {
            $isValidPath = true;
        }

        return $isValidPath;
    }
1151546
public function has($path)
    {
        $x = $this->xpath($path);

        return count($x) ? true : false;
    }
232015
public static function delete($path)
    {
        if (is_dir($path)) {
            Folder::delete($path);
        } elseif (is_file($path)) {
            File::delete($path);
        }

        return true;
    }
732190
public function checkPath($path)
    {
        $path = realpath($path);

        return ($path !== false && is_dir($path)) ? $path : false;
    }
718992
public function cd($path)
    {
        $path = $this->realpath($path);
        if ($path !== false && is_dir($path)) {
            return $this->path = $path;
        }

        return false;
    }
648993
public function isEmpty($path)
    {
        try {
            $value = $this->get($path);
        } catch (\OutOfBoundsException $e) {
            return true;
        }
        return '' === $value || null === $value;
    }
570917
public function has($path)
    {
        list($prefix, $path) = $this->getPrefixAndPath($path);

        return $this->getFilesystem($prefix)->has($path);
    }
481011
public function isDir($path)
    {
        $node = $this->at($path);
        return null !== $node && 'dir' === $node->type;
    }
726439
public static function rmdir($path)
    {
        $files = array_diff(scandir($path), array('.', '..'));

        $filesystem = new Filesystem();

        foreach ($files as $file) {
            $file = $path . DIRECTORY_SEPARATOR . $file;

            if (!file_exists($file)) {
                continue;
            }

            try {
                $filesystem->remove($file);
            } catch (IOException $exception) {
                return false;
            }
        }

        return true;
    }
428596
public function isUploadedFile($path)
    {
        if (!$path) {
            return false;
        }
        if (mb_orig_strpos($path, $this->getUploadTempDir() . '/') !== 0) {
            return false;
        }
        foreach ($this->attrs->files as $file) {
            if ($file['tmp_name'] === $path) {
                return true;
            }
        }
        return false;
    }
86652
public function checkPath($path = null)
    {
        if (is_null($path)) {
            $path = $this->getDir();
        }

        $real_path = realpath($path);
        if (!$real_path) {
            $real_path = realpath(dirname($path));
        }
        $upload_path = realpath($this->getUploadPath());

        if (strcasecmp($real_path, $upload_path) > 0) {
            return true;
        } else {
            throw new \Exception("Directory is not in the upload path", 403);
        }
    }
482559
public function delete($path)
    {
        $this->ftp->chdir($this->getDefaultPath());
        $result = $this->ftp->delete($path);
        if (!$result) {
            $files = $this->ftp->nlist($path);
            if ($files && is_array($files)) {
                foreach ($files as $file) {
                    $this->delete($file);
                }

                return $this->ftp->rmdir($path);
            }

            return false;
        }
    }
1161298
protected function checkPath($path)
    {
        if (is_dir($path)) {
            return true;
        }
        if (mkdir($path, 0755, true)) {
            return true;
        } else {
            return false;
        }
    }
1208640
public static function checkFolderPath($path){
      $path = substr($path,strpos($path,'/')+1);
      $path = explode('/',trim($path,'/'));
        foreach ( $path as $dir ){
          if ( !empty($dir) && !CKFinder_Connector_Utils_FileSystem::checkFolderName($dir) ){
            return false;
          }
        }

        return true;
    }
627818
public function has($path)
    {
        $file_stat = $this->getMetadata($path);
        return !empty($file_stat) ? true : false;
    }
1130116
public function isSubdir($path)
    {
        foreach ($this->storage as $member) {
            if ($member->isSubdirOf($path)) {
                return true;
            }
        }

        return false;
    }