take return of mkdir into account, throw exception on failure

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
pull/15290/head
Arthur Schiwon 7 years ago
parent 01410491b9
commit 009c2dfbd5
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
  1. 4
      lib/private/Files/Node/Folder.php

@ -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));

Loading…
Cancel
Save