diff options
author | Robin Appelman <robin@icewind.nl> | 2018-09-03 18:30:10 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-09-20 17:03:26 +0200 |
commit | 6372ae3a98537e8d1b5c5adf4fc446bc0651c2b1 (patch) | |
tree | 784a6fae2ac39cc4956ae42bbc24103a31b41ca3 /apps/files_trashbin/lib/Sabre/TrashFolderFile.php | |
parent | 58e281857f421b69479f9fa2a01d5d52410cde6a (diff) | |
download | nextcloud-server-6372ae3a98537e8d1b5c5adf4fc446bc0651c2b1.tar.gz nextcloud-server-6372ae3a98537e8d1b5c5adf4fc446bc0651c2b1.zip |
expose additional props from trashbin sabre endpoint
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_trashbin/lib/Sabre/TrashFolderFile.php')
-rw-r--r-- | apps/files_trashbin/lib/Sabre/TrashFolderFile.php | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/apps/files_trashbin/lib/Sabre/TrashFolderFile.php b/apps/files_trashbin/lib/Sabre/TrashFolderFile.php index 921c98b02fb..3e28d048b42 100644 --- a/apps/files_trashbin/lib/Sabre/TrashFolderFile.php +++ b/apps/files_trashbin/lib/Sabre/TrashFolderFile.php @@ -27,16 +27,13 @@ use OCP\Files\FileInfo; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\IFile; -class TrashFolderFile implements IFile, ITrash { +class TrashFolderFile extends AbstractTrash implements IFile, ITrash { /** @var string */ private $root; /** @var string */ private $userId; - /** @var FileInfo */ - private $data; - /** @var string */ private $location; @@ -46,8 +43,8 @@ class TrashFolderFile implements IFile, ITrash { string $location) { $this->root = $root; $this->userId = $userId; - $this->data = $data; $this->location = $location; + parent::__construct($data); } public function put($data) { @@ -58,51 +55,19 @@ class TrashFolderFile implements IFile, ITrash { return $this->data->getStorage()->fopen($this->data->getInternalPath(), 'rb'); } - public function getContentType(): string { - return $this->data->getMimetype(); - } - - public function getETag(): string { - return $this->data->getEtag(); - } - - public function getSize(): int { - return $this->data->getSize(); - } - public function delete() { \OCA\Files_Trashbin\Trashbin::delete($this->root . '/' . $this->getName(), $this->userId, null); } - public function getName(): string { - return $this->data->getName(); - } - public function setName($name) { throw new Forbidden(); } - public function getLastModified(): int { - return $this->data->getMtime(); - } - public function restore(): bool { return \OCA\Files_Trashbin\Trashbin::restore($this->root . '/' . $this->getName(), $this->data->getName(), null); } - public function getFilename(): string { - return $this->data->getName(); - } - public function getOriginalLocation(): string { return $this->location . '/' . $this->getFilename(); } - - public function getDeletionTime(): int { - return $this->getLastModified(); - } - - public function getFileId(): int { - return $this->data->getId(); - } } |