public static function createFromFilesystem(FilesystemInterface $filesystem)
    {
        $filesystem->addPlugin(new ListWith());

        $adapter = new static();
        $config = new Config();

        foreach ($filesystem->listWith(['timestamp', 'visibility'], '', true) as $meta) {
            if ($meta['type'] === 'dir') {
                $adapter->createDir($meta['path'], $config);
                continue;
            }

            $adapter->write($meta['path'], (string) $filesystem->read($meta['path']), $config);
            $adapter->setVisibility($meta['path'], $meta['visibility']);
            $adapter->setTimestamp($meta['path'], $meta['timestamp']);
        }

        return $adapter;
    }