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 NonExistingFile extends File {
|
|
|
|
|
/**
|
|
|
|
|
* @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 getContent() {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function putContent($data) {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-06 03:06:17 -04:00
|
|
|
public function getMimeType(): string {
|
2015-12-01 07:22:58 -05:00
|
|
|
if ($this->fileInfo) {
|
|
|
|
|
return parent::getMimeType();
|
|
|
|
|
} else {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
2013-09-01 13:47:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function fopen($mode) {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
|
}
|