take return of mkdir into account, throw exception on failure

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2019-04-29 16:12:01 +02:00 committed by Backportbot
parent e4d05cb669
commit aa91b0ab3c
1 changed files with 3 additions and 1 deletions

View File

@ -158,7 +158,9 @@ class Folder extends Node implements \OCP\Files\Folder {
$nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath);
$this->root->emit('\OC\Files', 'preWrite', array($nonExisting));
$this->root->emit('\OC\Files', 'preCreate', array($nonExisting));
$this->view->mkdir($fullPath);
if(!$this->view->mkdir($fullPath)) {
throw new NotPermittedException('Could not create folder');
}
$node = new Folder($this->root, $this->view, $fullPath);
$this->root->emit('\OC\Files', 'postWrite', array($node));
$this->root->emit('\OC\Files', 'postCreate', array($node));