protected function buildFilesystem(Container $app, array $parameters)
    {
        $adapter = new \ReflectionClass($parameters['adapter']);
        $filesystem = new Filesystem($adapter->newInstanceArgs($parameters['args']), $this->getConfig($parameters));

        foreach ($app['flysystem.plugins'] as $plugin) {
            $plugin->setFilesystem($filesystem);
            $filesystem->addPlugin($plugin);
        }

        return $filesystem;
    }