Verifies whether the current folder contains the expected directories.

@return bool
10453
private function areExpectedDirectoriesPresent(): bool
    {
        $actualDirectories = scandir(getcwd(), 0);

        $presentExpectedDirectories = array_intersect($this->expectedDirectories, $actualDirectories);
        sort($this->expectedDirectories);
        sort($presentExpectedDirectories);

        return $this->expectedDirectories === $presentExpectedDirectories;
    }
618489
public function rootDirExists()
    {
        $path = $this->getRootDir();
        return !empty($path) && @file_exists($path) && @is_dir($path);
    }
1256191
public function hasDirectory(string $id): bool
    {
        if (isset($this->directories[$id])) {
            return true;
        }

        $path = $this->getDirectoryPath($id);

        if ($this->filesystem->has($path)) {
            $info = $this->filesystem->getMetadata($path);

            return $info['type'] === 'dir';
        }

        return false;
    }
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;
    }
363473
public function dir_readdir()
    {
        $value = current($this->dirFiles);

        if (false === $value) {
            $result = false;
        } else {
            $result = $value;
            next($this->dirFiles);
        }

        return $result;
    }
883080
public function folderContent()
    {
        $result = [];
        $path = $this->ensureUserPath($this->blob->path);

        $list = collect($this->storage->getDriver()->listContents($path))
            ->pluck('path');

        $exclude = (new ThumbService($this->package))->getSizes()->all();
        $isExcluded = function ($path) use ($exclude) {
            $parts = explode('/', Str::normalizePath($path));
            if (count($parts) > 0) {
                return array_key_exists($parts[0], $exclude);
            }

            return false;
        };

        $list->each(function ($glob) use (&$result, $isExcluded) {
            if ($isExcluded($glob)) {
                // skip any thumbs dir and do not show it for users
                return;
            }

            $result[] = (new Blob($this->package))
                ->setPath($glob)
                ->fullDetails();
        });

        return $result;
    }
1193024
public static function checkOnDisk()
    {
        $args = func_get_args();
        if (count($args) == 2)
            $module = $args[0] . DIRECTORY_SEPARATOR . $args[1];
        elseif (count($args) == 1)
            $module = $args[1];
        else
            throw  new \Exception();
        $module = str_replace('\\', DIRECTORY_SEPARATOR, $module);
        return (bool)app('files')->exists(app_path('Modules') . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . 'Module.php');
    }
392178
public function exists(): bool
    {
        $realPath = \realpath($this->path);
        if (false === $realPath) {
            return false;
        }
        $this->path = $realPath;
        $this->assertCorrectType();

        return true;
    }
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;
    }
511929
public function containsDummyIds() {
    foreach ($this->getId() as $id) {
      if (self::isDummyId($id)) {
        return true;
      }
    }
    return false;
  }
255019
public function folderExists($path)
    {
        $folderName = basename($path);
        $folderPath = dirname($path);

        $path = self::validatePath($folderPath);
        $fullPath = $this->getMediaPath($path);

        $folders = $this->getStorageDisk()->directories($fullPath);
        foreach ($folders as $folder) {
            if (basename($folder) == $folderName) {
                return true;
            }
        }

        return false;
    }
802257
protected function isADirectory()
    {
        if (file_exists($this->path) && !is_dir($this->path)) {
            throw new  LocationIsADirectory(
                $this->getPath() .' already exists but is not a directory!',
                self::WRITABLE_IS_NOT_A_DIR_ERROR
            );
        }
        return true;
    }
111541
public function isDirectory($path)
    {
        // The root is always a directory
        if($path == '/') {
            return true;
        }
        $parentDir = $this->dirname($path);
        return in_array($path, $this->directories($parentDir));
    }
242205
public function checkFolders()
	{
		$dirHandle = opendir($this->getSourceFolder());

		if ($dirHandle === false)
		{
			$this->printTaskError('Can not open ' . $this->getSourceFolder() . ' for parsing');

			return false;
		}

		return true;
	}
779983
protected function pathExists($folder)
    {
        $folder = Str::studly($folder);

        return in_array($folder, $this->getAllBaseNames());
    }
492198
public function check(): bool
    {
        $path = \app()->storagePath();

        $this->description = Str::replace($this->description, \compact('path'));

        return $this->checkPathIsWritable($path);
    }
25754
public function isValidAbsolutePath()
    {
        if (!Path::isAbsolute($this->string)) {
            return false;
        }

        if (!is_dir($this->string)) {
            return false;
        }

        return true;
    }