public static function register(string $protocol, string $root = null, int $flags = 0): bool
    {
        $wrappers = stream_get_wrappers();
        if (in_array($protocol, $wrappers)) {
            throw new Exception(
                "Protocol '$protocol' has been already registered"
            );
        }
        $wrapper = stream_wrapper_register($protocol, get_called_class(), $flags);

        if ($wrapper) {
            if (null !== $root) {
                $content = Entity::newInstance($root);
            } else {
                $content = null;
            }

            $partition = new Partition($content);

            self::$partitions[$protocol] = $partition;
        }

        return $wrapper;
    }