protected function setRoot(EntityInterface $entity): void
    {
        if (!$entity->file_exists() || !$entity->is_dir()) {
            throw new Exception('Root directory is not valid');
        }

        $this->root = $entity;
    }