2013-09-01 13:47:48 -04:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2013-09-01 13:47:48 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2013-09-01 13:47:48 -04:00
|
|
|
*/
|
|
|
|
|
namespace OC\Files\Node;
|
|
|
|
|
|
2013-09-10 13:44:23 -04:00
|
|
|
use OCP\Files\NotFoundException;
|
2013-09-01 13:47:48 -04:00
|
|
|
|
|
|
|
|
class NonExistingFolder extends Folder {
|
|
|
|
|
/**
|
|
|
|
|
* @param string $newPath
|
2013-09-10 13:44:23 -04:00
|
|
|
* @throws \OCP\Files\NotFoundException
|
2013-09-01 13:47:48 -04:00
|
|
|
*/
|
|
|
|
|
public function rename($newPath) {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function delete() {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-03 02:29:33 -04:00
|
|
|
public function copy($targetPath) {
|
2013-09-01 13:47:48 -04:00
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function touch($mtime = null) {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getId() {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::getId();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
2024-08-28 11:13:41 -04:00
|
|
|
public function getInternalPath() {
|
|
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::getInternalPath();
|
|
|
|
|
} else {
|
|
|
|
|
return $this->getParent()->getMountPoint()->getInternalPath($this->getPath());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-01 13:47:48 -04:00
|
|
|
public function stat() {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getMTime() {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::getMTime();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
2023-01-23 09:03:56 -05:00
|
|
|
public function getSize($includeMounts = true): int|float {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
2019-02-27 09:35:44 -05:00
|
|
|
return parent::getSize($includeMounts);
|
2015-12-01 07:22:58 -05:00
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getEtag() {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::getEtag();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getPermissions() {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::getPermissions();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isReadable() {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::isReadable();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isUpdateable() {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::isUpdateable();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isDeletable() {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::isDeletable();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isShareable() {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::isShareable();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function get($path) {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getDirectoryListing() {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function nodeExists($path) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function newFolder($path) {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 19:14:52 -05:00
|
|
|
public function newFile($path, $content = null) {
|
2013-09-01 13:47:48 -04:00
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-03 02:29:33 -04:00
|
|
|
public function search($query) {
|
2013-09-01 13:47:48 -04:00
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-03 02:29:33 -04:00
|
|
|
public function searchByMime($mimetype) {
|
2013-09-01 13:47:48 -04:00
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-12 05:18:35 -05:00
|
|
|
public function searchByTag($tag, $userId) {
|
2014-12-04 08:01:15 -05:00
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-12 18:01:32 -04:00
|
|
|
public function searchBySystemTag(string $tagName, string $userId, int $limit = 0, int $offset = 0): array {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-01 13:47:48 -04:00
|
|
|
public function getById($id) {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-08 05:34:22 -05:00
|
|
|
public function getFirstNodeById(int $id): ?\OCP\Files\Node {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-01 13:47:48 -04:00
|
|
|
public function getFreeSpace() {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isCreatable() {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::isCreatable();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
}
|