NonExistingFolder.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OC\Files\Node;
  8. use OCP\Files\NotFoundException;
  9. class NonExistingFolder extends Folder {
  10. /**
  11. * @param string $newPath
  12. * @throws \OCP\Files\NotFoundException
  13. */
  14. public function rename($newPath) {
  15. throw new NotFoundException();
  16. }
  17. public function delete() {
  18. throw new NotFoundException();
  19. }
  20. public function copy($targetPath) {
  21. throw new NotFoundException();
  22. }
  23. public function touch($mtime = null) {
  24. throw new NotFoundException();
  25. }
  26. public function getId() {
  27. if ($this->fileInfo) {
  28. return parent::getId();
  29. } else {
  30. throw new NotFoundException();
  31. }
  32. }
  33. public function stat() {
  34. throw new NotFoundException();
  35. }
  36. public function getMTime() {
  37. if ($this->fileInfo) {
  38. return parent::getMTime();
  39. } else {
  40. throw new NotFoundException();
  41. }
  42. }
  43. public function getSize($includeMounts = true): int|float {
  44. if ($this->fileInfo) {
  45. return parent::getSize($includeMounts);
  46. } else {
  47. throw new NotFoundException();
  48. }
  49. }
  50. public function getEtag() {
  51. if ($this->fileInfo) {
  52. return parent::getEtag();
  53. } else {
  54. throw new NotFoundException();
  55. }
  56. }
  57. public function getPermissions() {
  58. if ($this->fileInfo) {
  59. return parent::getPermissions();
  60. } else {
  61. throw new NotFoundException();
  62. }
  63. }
  64. public function isReadable() {
  65. if ($this->fileInfo) {
  66. return parent::isReadable();
  67. } else {
  68. throw new NotFoundException();
  69. }
  70. }
  71. public function isUpdateable() {
  72. if ($this->fileInfo) {
  73. return parent::isUpdateable();
  74. } else {
  75. throw new NotFoundException();
  76. }
  77. }
  78. public function isDeletable() {
  79. if ($this->fileInfo) {
  80. return parent::isDeletable();
  81. } else {
  82. throw new NotFoundException();
  83. }
  84. }
  85. public function isShareable() {
  86. if ($this->fileInfo) {
  87. return parent::isShareable();
  88. } else {
  89. throw new NotFoundException();
  90. }
  91. }
  92. public function get($path) {
  93. throw new NotFoundException();
  94. }
  95. public function getDirectoryListing() {
  96. throw new NotFoundException();
  97. }
  98. public function nodeExists($path) {
  99. return false;
  100. }
  101. public function newFolder($path) {
  102. throw new NotFoundException();
  103. }
  104. public function newFile($path, $content = null) {
  105. throw new NotFoundException();
  106. }
  107. public function search($query) {
  108. throw new NotFoundException();
  109. }
  110. public function searchByMime($mimetype) {
  111. throw new NotFoundException();
  112. }
  113. public function searchByTag($tag, $userId) {
  114. throw new NotFoundException();
  115. }
  116. public function searchBySystemTag(string $tagName, string $userId, int $limit = 0, int $offset = 0): array {
  117. throw new NotFoundException();
  118. }
  119. public function getById($id) {
  120. throw new NotFoundException();
  121. }
  122. public function getFirstNodeById(int $id): ?\OCP\Files\Node {
  123. throw new NotFoundException();
  124. }
  125. public function getFreeSpace() {
  126. throw new NotFoundException();
  127. }
  128. public function isCreatable() {
  129. if ($this->fileInfo) {
  130. return parent::isCreatable();
  131. } else {
  132. throw new NotFoundException();
  133. }
  134. }
  135. }