public function delete() {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
$this->sendHooks(array('preDelete'));
+ $fileInfo = $this->getFileInfo();
$this->view->unlink($this->path);
- $nonExisting = new NonExistingFile($this->root, $this->view, $this->path);
+ $nonExisting = new NonExistingFile($this->root, $this->view, $this->path, $fileInfo);
$this->root->emit('\OC\Files', 'postDelete', array($nonExisting));
$this->exists = false;
$this->fileInfo = null;
public function delete() {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
$this->sendHooks(array('preDelete'));
+ $fileInfo = $this->getFileInfo();
$this->view->rmdir($this->path);
- $nonExisting = new NonExistingFolder($this->root, $this->view, $this->path);
+ $nonExisting = new NonExistingFolder($this->root, $this->view, $this->path, $fileInfo);
$this->root->emit('\OC\Files', 'postDelete', array($nonExisting));
$this->exists = false;
} else {
}
public function getId() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getId();
+ } else {
+ throw new NotFoundException();
+ }
}
public function stat() {
}
public function getMTime() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getMTime();
+ } else {
+ throw new NotFoundException();
+ }
}
public function getSize() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getSize();
+ } else {
+ throw new NotFoundException();
+ }
}
public function getEtag() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getEtag();
+ } else {
+ throw new NotFoundException();
+ }
}
public function getPermissions() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getPermissions();
+ } else {
+ throw new NotFoundException();
+ }
}
public function isReadable() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::isReadable();
+ } else {
+ throw new NotFoundException();
+ }
}
public function isUpdateable() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::isUpdateable();
+ } else {
+ throw new NotFoundException();
+ }
}
public function isDeletable() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::isDeletable();
+ } else {
+ throw new NotFoundException();
+ }
}
public function isShareable() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::isShareable();
+ } else {
+ throw new NotFoundException();
+ }
}
public function getContent() {
}
public function getMimeType() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getMimeType();
+ } else {
+ throw new NotFoundException();
+ }
}
public function fopen($mode) {
}
public function getId() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getId();
+ } else {
+ throw new NotFoundException();
+ }
}
public function stat() {
}
public function getMTime() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getMTime();
+ } else {
+ throw new NotFoundException();
+ }
}
public function getSize() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getSize();
+ } else {
+ throw new NotFoundException();
+ }
}
public function getEtag() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getEtag();
+ } else {
+ throw new NotFoundException();
+ }
}
public function getPermissions() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::getPermissions();
+ } else {
+ throw new NotFoundException();
+ }
}
public function isReadable() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::isReadable();
+ } else {
+ throw new NotFoundException();
+ }
}
public function isUpdateable() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::isUpdateable();
+ } else {
+ throw new NotFoundException();
+ }
}
public function isDeletable() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::isDeletable();
+ } else {
+ throw new NotFoundException();
+ }
}
public function isShareable() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::isShareable();
+ } else {
+ throw new NotFoundException();
+ }
}
public function get($path) {
}
public function isCreatable() {
- throw new NotFoundException();
+ if ($this->fileInfo) {
+ return parent::isCreatable();
+ } else {
+ throw new NotFoundException();
+ }
}
}
$test->assertInstanceOf('\OC\Files\Node\NonExistingFile', $node);
$test->assertEquals('foo', $node->getInternalPath());
$test->assertEquals('/bar/foo', $node->getPath());
+ $test->assertEquals(1, $node->getId());
+ $test->assertEquals('text/plain', $node->getMimeType());
$hooksRun++;
};
$view->expects($this->any())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL, 'fileid' => 1))));
+ ->will($this->returnValue($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL, 'fileid' => 1, 'mimetype' => 'text/plain'))));
$view->expects($this->once())
->method('unlink')
$test->assertInstanceOf('\OC\Files\Node\NonExistingFolder', $node);
$test->assertEquals('foo', $node->getInternalPath());
$test->assertEquals('/bar/foo', $node->getPath());
+ $test->assertEquals(1, $node->getId());
$hooksRun++;
};