protected function getWrapperInstance($base, $type = 'Directory')
    {
        $wrapper = $this->getWrapperClass($type);

        if ( ! $wrapper) {
            throw new \InvalidArgumentException(
                sprintf(
                    '<error>Unknown wrapper-type "%s"</error>',
                    $type
                )
            );
        }

        if (is_dir($base)) {
            $wrapper = $this->getWrapperClass('Directory');
        }

        $this->debug('Using wrapper "' . $wrapper . '" for "' . $base . '"');

        return new $wrapper($base);
    }