Create the file manager object

@param array  $parameters
@param string $dir_path
@param mixed  $driver
@return FileManager
542483
public function createFileManager(array $parameters, $driver, $dir_path = null)
    {
        $file_manager = new FileManager($parameters, $driver, $this->container);
        $this->file_manager = $file_manager;
        $file_manager->setDirPaths($dir_path);
        $this->setDisplayType();
        return $file_manager;
    }
638986
private function doBulkCreate(Driver $driver)
    {
        $isInserted = array();
        $countData = 0;
        $modelClass = $this->crudConfigurator->getCrud()->getModelClass();
        $formRequests = $this->request->get('form');

        foreach ($formRequests as $formRequest) {
            /** @var ModelInterface $model */
            $model = new $modelClass();
            $form = $this->crudConfigurator->getForm($model);

            $form->submit($formRequest[$form->getName()]);
            if ($form->isValid()) {
                if (true === $this->crudOperationHandler->save($driver, $model)) {
                    $isInserted[] = $model->getId();
                }

                ++$countData;
            }
        }

        return array(
            'count' => $countData,
            'data' => $isInserted,
        );
    }
1059167
public static function createDir($dirPath, $mode = 0711)
    {
        if (false === file_exists($dirPath)) {
            if (false === mkdir($dirPath, $mode, true)) {
                throw new RuntimeException(sprintf('unable to create directory "%s"', $dirPath));
            }
        }
    }
416470
public function createFolder($container, $path, $is_public = true, $properties = [], $check_exist = true)
    {
        if (empty($path)) {
            throw new BadRequestException("Invalid empty path.");
        }

        // does this folder already exist?
        $path = FileUtilities::fixFolderPath($path);
        if ($this->folderExists($container, $path)) {
            if ($check_exist) {
                throw new BadRequestException("Folder '$path' already exists.");
            }

            return;
        }
        // does this folder's parent exist?
        $parent = FileUtilities::getParentFolder($path);
        if (!empty($parent) && (!$this->folderExists($container, $parent))) {
            if ($check_exist) {
                throw new NotFoundException("Folder '$parent' does not exist.");
            }
            $this->createFolder($container, $parent, $is_public, $properties, false);
        }

        // create the folder
        $this->checkContainerForWrite($container); // need to be able to write to storage
        $properties = (empty($properties)) ? '' : json_encode($properties);
        $this->putBlobData($container, $path, $properties);
    }
950067
public function instantiateManager($config, $manager, $path)
    {
        return is_null($manager)
            ? new NetteManager($config, $path)
            : $manager;
    }
598576
public function getFileManager()
    {
        if ($this->file_manager_instance === null) {
            $this->file_manager_instance = new FileManager($this);
        }

        return $this->file_manager_instance;
    }
23534
public function createFolder($folderName, \Google_Service_Drive_DriveFile $parentFolder = null)
    {
        return $this->createFile($folderName, self::MIME_FOLDER, $parentFolder);
    }
1214263
public static void actionCreate(PageContext pc, Resource directory, String serverPassword, boolean createPath, int mode, Object acl, String storage, int nameConflict)
	    throws PageException {

	SecurityManager securityManager = pc.getConfig().getSecurityManager();
	securityManager.checkFileLocation(pc.getConfig(), directory, serverPassword);

	if (directory.exists()) {
	    if (directory.isDirectory()) {
		if (nameConflict == NAMECONFLICT_SKIP) return;

		throw new ApplicationException("directory [" + directory.toString() + "] already exist");
	    }
	    else if (directory.isFile()) throw new ApplicationException("can't create directory [" + directory.toString() + "], it exist a file with same name");
	}
	// if(!directory.mkdirs()) throw new ApplicationException("can't create directory
	// ["+directory.toString()+"]");
	try {
	    directory.createDirectory(createPath);
	}
	catch (IOException ioe) {
	    throw Caster.toPageException(ioe);
	}

	// set S3 stuff
	setS3Attrs(pc, directory, acl, storage);

	// Set Mode
	if (mode != -1) {
	    try {
		directory.setMode(mode);
		// FileUtil.setMode(directory,mode);
	    }
	    catch (IOException e) {
		throw Caster.toPageException(e);
	    }
	}
    }
591000
public function mkdir($dirs, $mode = 0777)
    {
        foreach ($this->toIterator($dirs) as $dir) {
            if (is_dir($dir)) {
                continue;
            }

            if (true !== @mkdir($dir, $mode, true)) {
                throw new \RuntimeException(sprintf('Failed to create "%s".', $dir), 0, null);
            }
        }
    }
1243223
public function mkdir($dirs, $mode = 0777)
    {
        foreach ($this->toIterator($dirs) as $dir) {
            if (is_dir($dir)) {
                continue;
            }

            if (true !== @mkdir($dir, $mode, true)) {
                throw new IOException(sprintf('Failed to create %s', $dir));
            }
        }
    }
763007
public function getImageManager()
    {
        $driver = 'gd';

        if (isset($this->config['driver'])) {
            $driver = $this->config['driver'];
        }

        return new ImageManager([
            'driver' => $driver,
        ]);
    }
77479
private function createYmlDriver($driverName, array $driverConfig, ContainerBuilder $container)
    {
        // Definition directories
        list($modelDir, $mixinDir, $embedDir) = $this->getDefinitionDirs($driverConfig, $container);

        // Set the directories to the dirs container parameter.
        Utility::appendParameter('dirs', sprintf('%s.model_dir', $driverName), $modelDir, $container);
        Utility::appendParameter('dirs', sprintf('%s.mixin_dir', $driverName), $mixinDir, $container);
        Utility::appendParameter('dirs', sprintf('%s.embed_dir', $driverName), $embedDir, $container);

        // File locator
        $locatorName = sprintf('%s.file_locator', $driverName);
        $locatorDef = $this->createFileLocator($modelDir, $mixinDir, $embedDir);
        $container->setDefinition($locatorName, $locatorDef);

        // Driver
        return new Definition(
            Utility::getLibraryClass('Metadata\Driver\YamlFileDriver'),
            [
                new Reference($locatorName),
                new Reference(Utility::getAliasedName('storage_manager')),
            ]
        );
    }
624877
protected function mergeParameter($var, $container, $dir, $file_name = 'blast.yml')
    {
        $loader = new YamlFileLoader($newContainer = new ContainerBuilder(), new FileLocator($dir));
        $loader->load($file_name);

        if (!$container->hasParameter($var) || !is_array($container->getParameter($var))) {
            $container->setParameter($var, []);
        }

        if (!is_array($newContainer->getParameter($var))) {
            return $this;
        }

        $container->setParameter($var, array_merge(
            $container->getParameter($var),
            $newContainer->getParameter($var)
        ));

        return $this;
    }
730761
public function enableFilemanager($path = DIR_PUBLIC_URL)
    {
        $this->setWidget(FileManager::getInstance()->setPath($path));

        return $this;
    }
932404
protected function createDriver($driver)
    {
        if (isset($this->customCreators[ $driver ])) {
            return $this->callCustomCreator($driver);
        }

        return $this->buildCustomProvider($driver);
    }
1342021
public function driver($driver)
    {
        $this->container['sms.sender'] = $this->container->share(function ($app) use ($driver) {
            return (new DriverManager($app))->driver($driver);
        });

        $this->driver = $this->container['sms.sender'];
    }
1260300
public static void makesureDirExists(Path dirPath) throws IOException {
		Validate.notNull(dirPath);
		Files.createDirectories(dirPath);
	}