Get Filesystem adapter for the user data directory of the dedicated server.

@return FilesystemInterface
428668
public function getUserData() : FilesystemInterface
    {
        if ($this->connectionType == self::CONNECTION_TYPE_LOCAL) {
            return $this->getLocalAdapter();
        } else {
            return $this->remoteAdapter;
        }
    }
38148
private function getFsRoot(): ?string
    {
        if (null === $this->fsRoot) {
            $tempDir = rtrim(sys_get_temp_dir(), '\\/');

            do {
                $name = $tempDir.'/'.uniqid('vfs', true);
            } while (file_exists($name));

            $this->fs->mkdir($name);
            $this->fsRoot = $name;
        }

        return $this->fsRoot;
    }
90342
public static function storageInstance() {
		if (self::$instance) {
			return self::$instance;
		}

		if (!isset(self::$registry[self::driver()])) {
			throw new StorageException("Invalid driver '".self::driver()."'");
		}

		$class = self::$registry[self::driver()];
		self::$instance = new $class();

		return self::$instance;
	}
281861
public function getFileSystem() {
    if (empty($this->fileSystem)) {
      $this->fileSystem = \Drupal::service('file_system');
    }
    return $this->fileSystem;
  }
1145129
public synchronized FileSystem getFs() throws IOException {
    if (this.fs == null) {
      Path sysDir = getSystemDir();
      this.fs = sysDir.getFileSystem(getConf());
    }
    return fs;
  }
664862
public function getFileSystem()
    {
        if (null == $this->fileSystem) {
            $this->setFileSystem(Helper::getFileSystem());
        }

        return $this->fileSystem;
    }
194696
public function getConfigDirectory()
    {
        $directory = $this->baseDir.DIRECTORY_SEPARATOR.BundleInterface::CONFIG_DIRECTORY_NAME;
        if (false === is_dir($directory)) {
            $directory = $this->baseDir.DIRECTORY_SEPARATOR.BundleInterface::OLD_CONFIG_DIRECTORY_NAME;
        }

        return $directory;
    }
1162093
static public FileSystemManager getManager(){
		StandardFileSystemManager fsManager = new StandardFileSystemManager();
		try {
			fsManager.init();
		} catch (FileSystemException e) {
			log.error("Cannot initialize StandardFileSystemManager.", e);
		}
		return fsManager;
	}
912112
public function getFileManager()
    {
        if ($this->fileManager === null) {
            if ($this->config()->file_manager_enabled_by_default) {
                return true;
            } else {
                return false;
            }
        }
        return $this->fileManager;
    }
1315235
public function getSource()
    {
        if (!isset($this->config['source'])) {
            throw new InvalidArgumentException('A "source" file system must be set.');
        }

        if (is_string($this->config['source'])) {
            return new Filesystem(
                new Local($this->config['source'])
            );
        }

        return $this->config['source'];
    }
674454
public function locateRootDirectory()
    {
        $vendorDirectoryName = 'vendor';
        $fileDirectory    = __DIR__;
        $searchDirectories = [
            __DIR__.'/..',
            __DIR__.'/../..',
            __DIR__.'/../../..',
            __DIR__.'/../../../..',
            __DIR__.'/../../../../..'
        ];

        $fileSystem = $this->createNew(FileSystem::class);
        foreach ($searchDirectories as $searchDirectory) {
            if ($fileSystem->fileExists($searchDirectory . '/' . $vendorDirectoryName)) {
                return $fileSystem->getRealPath($searchDirectory);
            }
        }

        throw new FileSystemException('No application root directory found');
    }
112999
public function getAdapter() {
		if ($this->_adapter === null) {
			if ($this->hasLocator()) {
				$this->_adapter = $this->getLocator()->get($this->getAdapterName());
			} else {
				throw new Exceptions\NoAdapter('Nor a database adapter neither a services locator has been provided');
			}
		}
		
		return $this->_adapter;
	}
133418
public function fs()
    {
        if (null === $this->fs)
            $this->fs = new Filesystem($this->getFilesystemPath(), $this->adapter);
        return $this->fs;
    }
112861
public function getSystem(): Adapter\System
    {
        if ($this->system === null) {
            $this->system = new Adapter\System($this);
        }

        return $this->system;
    }
478838
public static function cacheDirectory()
    {
        $ini = eZINI::instance();
        $cacheDir = $ini->variable( 'FileSettings', 'CacheDir' );

        if ( $cacheDir[0] == "/" )
        {
            return eZDir::path( array( $cacheDir ) );
        }
        else
        {
            return eZDir::path( array( self::varDirectory(), $cacheDir ) );
        }
    }
1220273
private function getAdapterNode()
    {
        $node = $this->createRootNode('adapter');
        return $node
            ->isRequired()
            ->addDefaultsIfNotSet()
            ->children()
                ->enumNode('type')
                    ->values(['jsonapiorg', null])
                ->end()
                ->scalarNode('service')->cannotBeEmpty()->end()
            ->end()
            ->validate()
                ->always(function($v) {
                    $this->validateAdapter($v);
                    return $v;
                })
            ->end()
        ;
    }
1016648
private function getStorage()
    {
        $folder = $this->folder;
        if (!is_dir($folder)) {
            if (!mkdir($folder, 0777, true)) {
                throw new Exception("Can not create Filesystem folder: '" . $folder . "'. Please verify permissions.");
            }
        }

        return $folder;
    }