@@ -25,155 +25,155 @@ |
||
| 25 | 25 | use OCP\Files\Storage\IStorage; |
| 26 | 26 | |
| 27 | 27 | class NullStorage extends Common { |
| 28 | - public function __construct($parameters) { |
|
| 29 | - parent::__construct($parameters); |
|
| 30 | - } |
|
| 28 | + public function __construct($parameters) { |
|
| 29 | + parent::__construct($parameters); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - public function getId() { |
|
| 33 | - return 'null'; |
|
| 34 | - } |
|
| 32 | + public function getId() { |
|
| 33 | + return 'null'; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - public function mkdir($path) { |
|
| 37 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 38 | - } |
|
| 36 | + public function mkdir($path) { |
|
| 37 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - public function rmdir($path) { |
|
| 41 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 42 | - } |
|
| 40 | + public function rmdir($path) { |
|
| 41 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - public function opendir($path) { |
|
| 45 | - return new IteratorDirectory([]); |
|
| 46 | - } |
|
| 44 | + public function opendir($path) { |
|
| 45 | + return new IteratorDirectory([]); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - public function is_dir($path) { |
|
| 49 | - return $path === ''; |
|
| 50 | - } |
|
| 48 | + public function is_dir($path) { |
|
| 49 | + return $path === ''; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - public function is_file($path) { |
|
| 53 | - return false; |
|
| 54 | - } |
|
| 52 | + public function is_file($path) { |
|
| 53 | + return false; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - public function stat($path) { |
|
| 57 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 58 | - } |
|
| 56 | + public function stat($path) { |
|
| 57 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - public function filetype($path) { |
|
| 61 | - return ($path === '') ? 'dir' : false; |
|
| 62 | - } |
|
| 60 | + public function filetype($path) { |
|
| 61 | + return ($path === '') ? 'dir' : false; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - public function filesize($path) { |
|
| 65 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 66 | - } |
|
| 64 | + public function filesize($path) { |
|
| 65 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - public function isCreatable($path) { |
|
| 69 | - return false; |
|
| 70 | - } |
|
| 68 | + public function isCreatable($path) { |
|
| 69 | + return false; |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - public function isReadable($path) { |
|
| 73 | - return $path === ''; |
|
| 74 | - } |
|
| 72 | + public function isReadable($path) { |
|
| 73 | + return $path === ''; |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - public function isUpdatable($path) { |
|
| 77 | - return false; |
|
| 78 | - } |
|
| 76 | + public function isUpdatable($path) { |
|
| 77 | + return false; |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - public function isDeletable($path) { |
|
| 81 | - return false; |
|
| 82 | - } |
|
| 80 | + public function isDeletable($path) { |
|
| 81 | + return false; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - public function isSharable($path) { |
|
| 85 | - return false; |
|
| 86 | - } |
|
| 84 | + public function isSharable($path) { |
|
| 85 | + return false; |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - public function getPermissions($path) { |
|
| 89 | - return null; |
|
| 90 | - } |
|
| 88 | + public function getPermissions($path) { |
|
| 89 | + return null; |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - public function file_exists($path) { |
|
| 93 | - return $path === ''; |
|
| 94 | - } |
|
| 92 | + public function file_exists($path) { |
|
| 93 | + return $path === ''; |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - public function filemtime($path) { |
|
| 97 | - return ($path === '') ? time() : false; |
|
| 98 | - } |
|
| 96 | + public function filemtime($path) { |
|
| 97 | + return ($path === '') ? time() : false; |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - public function file_get_contents($path) { |
|
| 101 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 102 | - } |
|
| 100 | + public function file_get_contents($path) { |
|
| 101 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - public function file_put_contents($path, $data) { |
|
| 105 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 106 | - } |
|
| 104 | + public function file_put_contents($path, $data) { |
|
| 105 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - public function unlink($path) { |
|
| 109 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 110 | - } |
|
| 108 | + public function unlink($path) { |
|
| 109 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | - public function rename($path1, $path2) { |
|
| 113 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 114 | - } |
|
| 112 | + public function rename($path1, $path2) { |
|
| 113 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 114 | + } |
|
| 115 | 115 | |
| 116 | - public function copy($path1, $path2) { |
|
| 117 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 118 | - } |
|
| 116 | + public function copy($path1, $path2) { |
|
| 117 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 118 | + } |
|
| 119 | 119 | |
| 120 | - public function fopen($path, $mode) { |
|
| 121 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 122 | - } |
|
| 120 | + public function fopen($path, $mode) { |
|
| 121 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | - public function getMimeType($path) { |
|
| 125 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 126 | - } |
|
| 124 | + public function getMimeType($path) { |
|
| 125 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | - public function hash($type, $path, $raw = false) { |
|
| 129 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 130 | - } |
|
| 128 | + public function hash($type, $path, $raw = false) { |
|
| 129 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 130 | + } |
|
| 131 | 131 | |
| 132 | - public function free_space($path) { |
|
| 133 | - return FileInfo::SPACE_UNKNOWN; |
|
| 134 | - } |
|
| 132 | + public function free_space($path) { |
|
| 133 | + return FileInfo::SPACE_UNKNOWN; |
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | - public function touch($path, $mtime = null) { |
|
| 137 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 138 | - } |
|
| 136 | + public function touch($path, $mtime = null) { |
|
| 137 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - public function getLocalFile($path) { |
|
| 141 | - return false; |
|
| 142 | - } |
|
| 140 | + public function getLocalFile($path) { |
|
| 141 | + return false; |
|
| 142 | + } |
|
| 143 | 143 | |
| 144 | - public function hasUpdated($path, $time) { |
|
| 145 | - return false; |
|
| 146 | - } |
|
| 144 | + public function hasUpdated($path, $time) { |
|
| 145 | + return false; |
|
| 146 | + } |
|
| 147 | 147 | |
| 148 | - public function getETag($path) { |
|
| 149 | - return ''; |
|
| 150 | - } |
|
| 148 | + public function getETag($path) { |
|
| 149 | + return ''; |
|
| 150 | + } |
|
| 151 | 151 | |
| 152 | - public function isLocal() { |
|
| 153 | - return false; |
|
| 154 | - } |
|
| 152 | + public function isLocal() { |
|
| 153 | + return false; |
|
| 154 | + } |
|
| 155 | 155 | |
| 156 | - public function getDirectDownload($path) { |
|
| 157 | - return false; |
|
| 158 | - } |
|
| 156 | + public function getDirectDownload($path) { |
|
| 157 | + return false; |
|
| 158 | + } |
|
| 159 | 159 | |
| 160 | - public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) { |
|
| 161 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 162 | - } |
|
| 160 | + public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) { |
|
| 161 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | - public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) { |
|
| 165 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 166 | - } |
|
| 164 | + public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) { |
|
| 165 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
| 166 | + } |
|
| 167 | 167 | |
| 168 | - public function test() { |
|
| 169 | - return true; |
|
| 170 | - } |
|
| 168 | + public function test() { |
|
| 169 | + return true; |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | - public function getOwner($path) { |
|
| 173 | - return null; |
|
| 174 | - } |
|
| 172 | + public function getOwner($path) { |
|
| 173 | + return null; |
|
| 174 | + } |
|
| 175 | 175 | |
| 176 | - public function getCache($path = '', $storage = null) { |
|
| 177 | - return new NullCache(); |
|
| 178 | - } |
|
| 176 | + public function getCache($path = '', $storage = null) { |
|
| 177 | + return new NullCache(); |
|
| 178 | + } |
|
| 179 | 179 | } |