take return of mkdir into account, throw exception on failure
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
e4d05cb669
commit
aa91b0ab3c
|
@ -158,7 +158,9 @@ class Folder extends Node implements \OCP\Files\Folder {
|
||||||
$nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath);
|
$nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath);
|
||||||
$this->root->emit('\OC\Files', 'preWrite', array($nonExisting));
|
$this->root->emit('\OC\Files', 'preWrite', array($nonExisting));
|
||||||
$this->root->emit('\OC\Files', 'preCreate', 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);
|
$node = new Folder($this->root, $this->view, $fullPath);
|
||||||
$this->root->emit('\OC\Files', 'postWrite', array($node));
|
$this->root->emit('\OC\Files', 'postWrite', array($node));
|
||||||
$this->root->emit('\OC\Files', 'postCreate', array($node));
|
$this->root->emit('\OC\Files', 'postCreate', array($node));
|
||||||
|
|
Loading…
Reference in New Issue