src/Adapter/LeagueFilesystemAdapterFactory.php
public function createFilesystemAdapter(SubjectConfigurationInterface $subjectConfiguration)
    {

        // the filesystem adapter configuration
        $filesystemAdapterConfiguration = $subjectConfiguration->getFilesystemAdapter();

        // load the filesystem adapter's adapter configuration (FS specific)
        $adapterConfiguration = $filesystemAdapterConfiguration->getAdapter();

        // load the adapter parameters
        $adapterParams = $adapterConfiguration->getParams();

        // initialize the root directory, if not specified in the adapter parameters
        if (!isset($adapterParams[ConfigurationKeys::ROOT])) {
            $adapterParams[ConfigurationKeys::ROOT] = getcwd();
        }

        // load the adapter to use
        $reflectionClass = new \ReflectionClass($adapterConfiguration->getType());
        $adapter =  $reflectionClass->newInstanceArgs(ConfigurationUtil::prepareConstructorArgs($reflectionClass, $adapterParams));

        // create a new filesystem instance
        return new LeagueFilesystemAdapter(new Filesystem($adapter));
    }
public function createFilesystemAdapter(SubjectConfigurationInterface $subjectConfiguration)
    {

        // the filesystem adapter configuration
        $filesystemAdapterConfiguration = $subjectConfiguration->getFilesystemAdapter();

        // load the filesystem adapter's adapter configuration (FS specific)
        $adapterConfiguration = $filesystemAdapterConfiguration->getAdapter();

        // load the adapter parameters
        $adapterParams = $adapterConfiguration->getParams();

        // initialize the root directory, if not specified in the adapter parameters
        if (!isset($adapterParams[ConfigurationKeys::ROOT])) {
            $adapterParams[ConfigurationKeys::ROOT] = getcwd();
        }

        // load the adapter to use
        $reflectionClass = new \ReflectionClass($adapterConfiguration->getType());
        $adapter =  $reflectionClass->newInstanceArgs(ConfigurationUtil::prepareConstructorArgs($reflectionClass, $adapterParams));

        // create a new filesystem instance
        return new LeagueFilesystemAdapter(new Filesystem($adapter));
    }
Factory method to create new filesystem adapter instance.

@param \TechDivision\Import\Configuration\SubjectConfigurationInterface $subjectConfiguration The subject configuration

@return \TechDivision\Import\Adapter\FilesystemAdapterInterface The filesystem adapter instance