Get a filesystem instance.

@param  string  $name
@return \League\Flysystem\AdapterInterface
485162
private function resolveAdapter($name, $configs)
	{
		try{
			$adatperClass = $this->app->get('\TitaPHP\Filesystem\\'.ucfirst($name).'Adapter');
		}
		catch(NotFoundException $e){
			throw new \Exception("Filesystem driver {$name} could not be located");
		}

		$adapter = $adatperClass->adapt($configs);

		if (!$adapter instanceof \League\Flysystem\AdapterInterface)
			throw new \Exception('Adapter must be instance of \League\Flysystem\AdapterInterface');

		return $adapter;
	}
93935
public function getFileSystem($id)
    {
        if (!isset($this->filesystems[$id])) {
            $this->filesystems[$id] = new FileSystem($id, $this->getFlysystemAdapter($id));
        }
        return $this->filesystems[$id];
    }
517448
public function getEnvironment($name)
    {
        if (isset($this->environments[$name])) {
            return $this->environments[$name];
        }

        // check the environment exists
        if (!$this->getConfig()->hasEnvironment($name)) {
            throw new \InvalidArgumentException(sprintf(
                'The environment "%s" does not exist',
                $name
            ));
        }

        // create an environment instance and cache it
        $envOptions = $this->getConfig()->getEnvironment($name);
        $envOptions['version_order'] = $this->getConfig()->getVersionOrder();

        $environment = new Environment($name, $envOptions);
        $this->environments[$name] = $environment;
        $environment->setInput($this->getInput());
        $environment->setOutput($this->getOutput());

        return $environment;
    }
514225
public function get($name)
    {
        if (isset($this->instances[$name])) {
            return $this->instances[$name];
        }
        if (! isset($this->registry[$name])) {
            $exceptionClass = static::NOT_FOUND_EXCEPTION;
            throw new $exceptionClass(
                sprintf(static::NOT_FOUND_MESSAGE, $name)
            );
        }
        try {
            $this->instances[$name] = $this->build($this->registry[$name], $name);
        } catch (Exception $e) {
            throw new RuntimeException(
                sprintf(static::BUILD_FAILURE_MESSAGE, $name),
                null,
                $e
            );
        }

        return $this->instances[$name];
    }
123605
public function getPath($name)
    {
        if ($this->callerNotSelfOrPathsProxy()) {
            Deprecated::method(3.3, 'Use Bolt\Filesystem (recommended) or PathResolver::resolve instead.');
        }

        return $this->getPathObject($name)->string();
    }
1200079
public function getFile($name)
    {
        if (!isset($this->files)) {
            $files = $this->getUploadedFiles();
            foreach ($files as $file) {
                $key = $file->getKey();
                if (isset($key)) {
                    $this->files[$key] = $file;
                } else {
                    $this->files[] = $file;
                }
            }
        }
        if (isset($this->files[$name])) {
            return $this->files[$name];
        } else {
            throw new \InvalidArgumentException("Upload file '$name' is empty");
        }
    }
530530
public static function getInstance($name)
    {
        if (!isset(static::$instance[strtolower($name)])) {
            $name = ucfirst($name);

            static::$instance[strtolower($name)] = sprintf(__NAMESPACE__ . '\%s\%sGrammar', $name, $name);
        }

        return static::$instance[strtolower($name)];
    }
1295429
public function get($name)
    {
        if (!isset($this->adapters[$name])) {
            throw new \InvalidArgumentException(sprintf('No Adapter with name "%s" is registered.', $name));
        }

        return $this->adapters[$name];
    }
997678
public function get($name)
    {
        $this->checkNameIsString($name);

        if (isset($this->encrypters[$name])) {
            $encrypter = $this->encrypters[$name];
        } else {
            if (isset($this->configs[$name])) {
                $config = $this->configs[$name];
                $encrypter = new ManagedEncrypter($config);

                $this->encrypters[$name] = $encrypter;
            } else {
                throw new \InvalidArgumentException('Unknown encrypter (' . $name . ')');
            }
        }

        return $encrypter;
    }
355043
public function getBackup($name = null)
    {
        $name = is_null($name) ? 'default' : $name;

        if ( ! $this->backupExists($name)) {
            throw new \Intervention\Image\Exception\RuntimeException(
                "Backup with name ({$name}) not available. Call backup() before reset()."
            );
        }

        return $this->backups[$name];
    }
1264602
protected function resolve($name)
    {
        $config = $this->disks[$name];
        if (isset($config['class'])) {
            return Yii::createObject($config);
        } else if (isset($config['adapter'])) {
            $driverMethod = 'create' . ucfirst($config['adapter']) . 'Adapter';
            if (method_exists($this, $driverMethod)) {
                return $this->{$driverMethod}($config);
            } else {
                throw new InvalidArgumentException("Adapter [{$config['adapter']}] is not supported.");
            }
        } else {
            throw new InvalidArgumentException("Wrong adapter configuration.");
        }
    }
1041912
public function get(string $name = null)
    {
        if (null != $name) {
            return $this->createStreamWriter($name);
        }

        return $this->createAsAvailable();
    }
703205
public static function getInstance(bool $normalize = null): Filesystem
    {
        if ($normalize === true) {
            $instance = &static::$safe;
        } elseif ($normalize === false) {
            $instance = &static::$unsafe;
        } else {
            $instance = &static::$default;
        }

        if (null === $instance) {
            $instance = new static($normalize);
        }

        return $instance;
    }
933238
public function disk($name = null)
    {
        $name = $name ?: $this->getDefaultDriver();

        return $this->disks[$name] = $this->get($name);
    }
1038462
public function getAdapter(string $name): ShellAdapterInterface
    {
        if (!array_key_exists($name, $this->shellAdapters)) {
            throw new Exception\DomainException("Shell adapter \"$name\" not found.");
        }

        return clone $this->shellAdapters[$name];
    }
218070
public function findWorkingDirectory($name)
    {
        $path = $this->getWorkingDirectory().'/'.$name;

        if ($this->withinWorkingDirectory() and $this->files->exists($path))
        {
            return $path;
        }
    }
1052685
public function makeDisk($dir) {

        // Check if the dir refers to an IoC binding and return it
        if ($this->app->bound($dir)
            && ($instance = $this->app->make($dir))
            && (is_a($instance, 'League\Flysystem\Filesystem')
                || is_a($instance, 'League\Flysystem\Cached\CachedAdapter'))
            ) return $instance;

        // Instantiate a new Flysystem instance for local dirs
        return new Filesystem(new Adapter($dir));
    }