Jarves\Controller\Admin\FileController::createFolderAction PHP Method

createFolderAction() public method

public createFolderAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : boolean
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return boolean
    public function createFolderAction(ParamFetcher $paramFetcher)
    {
        $path = $paramFetcher->get('path');
        $pseudoItem = ['path' => $path, 'type' => FileInfo::DIR];
        //are we allowed to create this type of dir?
        $aclRequest = ACLRequest::create('jarves/file', $pseudoItem)->onlyAddMode()->setPrimaryObjectItem($pseudoItem);
        $this->checkOrThrow($aclRequest);
        //are we allowed to update the target folder?
        $aclRequest = ACLRequest::create('jarves/file', ['path' => dirname($path)])->onlyUpdateMode();
        $this->checkOrThrow($aclRequest);
        if ($result = $this->webFilesystem->mkdir($path)) {
            $this->newFeed($path, 'created', $path);
        }
        return $result;
    }