2015-10-30 15:09:07 +03:00
|
|
|
<?php
|
|
|
|
/**
|
2016-07-21 18:07:57 +03:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Bjoern Schiessle <bjoern@schiessle.org>
|
2016-05-26 20:56:05 +03:00
|
|
|
* @author Björn Schießle <bjoern@schiessle.org>
|
2020-04-29 12:57:22 +03:00
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Daniel Calviño Sánchez <danxuliu@gmail.com>
|
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
|
|
|
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
|
|
|
* @author Maxence Lange <maxence@nextcloud.com>
|
2017-11-06 17:56:42 +03:00
|
|
|
* @author Robin Appelman <robin@icewind.nl>
|
2016-07-21 18:07:57 +03:00
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
2015-10-30 15:09:07 +03:00
|
|
|
*
|
|
|
|
* @license AGPL-3.0
|
|
|
|
*
|
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
2015-10-30 15:09:07 +03:00
|
|
|
*
|
|
|
|
*/
|
2019-11-22 22:52:10 +03:00
|
|
|
|
2015-10-30 15:09:07 +03:00
|
|
|
namespace OC\Share20;
|
|
|
|
|
2016-11-17 16:18:47 +03:00
|
|
|
use OCP\Files\Cache\ICacheEntry;
|
2016-02-04 16:28:09 +03:00
|
|
|
use OCP\Files\File;
|
2016-02-04 14:51:23 +03:00
|
|
|
use OCP\Files\IRootFolder;
|
2015-10-30 15:09:07 +03:00
|
|
|
use OCP\Files\Node;
|
2016-02-04 14:51:23 +03:00
|
|
|
use OCP\Files\NotFoundException;
|
2016-05-11 21:48:27 +03:00
|
|
|
use OCP\IUserManager;
|
2016-03-23 16:08:40 +03:00
|
|
|
use OCP\Share\Exceptions\IllegalIDChangeException;
|
2018-10-15 09:47:07 +03:00
|
|
|
use OCP\Share\IShare;
|
2015-10-30 15:09:07 +03:00
|
|
|
|
2016-01-27 14:13:53 +03:00
|
|
|
class Share implements \OCP\Share\IShare {
|
2015-10-30 15:09:07 +03:00
|
|
|
|
|
|
|
/** @var string */
|
2015-10-30 15:10:08 +03:00
|
|
|
private $id;
|
2016-01-13 15:02:23 +03:00
|
|
|
/** @var string */
|
|
|
|
private $providerId;
|
2015-10-30 15:09:07 +03:00
|
|
|
/** @var Node */
|
2016-02-04 14:51:23 +03:00
|
|
|
private $node;
|
|
|
|
/** @var int */
|
|
|
|
private $fileId;
|
2016-02-04 16:28:09 +03:00
|
|
|
/** @var string */
|
|
|
|
private $nodeType;
|
2015-10-30 15:09:07 +03:00
|
|
|
/** @var int */
|
|
|
|
private $shareType;
|
2016-02-04 14:51:23 +03:00
|
|
|
/** @var string */
|
2015-10-30 15:10:08 +03:00
|
|
|
private $sharedWith;
|
2016-02-04 14:51:23 +03:00
|
|
|
/** @var string */
|
2017-06-06 14:21:42 +03:00
|
|
|
private $sharedWithDisplayName;
|
|
|
|
/** @var string */
|
|
|
|
private $sharedWithAvatar;
|
|
|
|
/** @var string */
|
2015-10-30 15:09:07 +03:00
|
|
|
private $sharedBy;
|
2016-02-04 14:51:23 +03:00
|
|
|
/** @var string */
|
2015-10-30 15:09:07 +03:00
|
|
|
private $shareOwner;
|
|
|
|
/** @var int */
|
|
|
|
private $permissions;
|
2019-08-21 17:15:23 +03:00
|
|
|
/** @var int */
|
|
|
|
private $status;
|
2018-07-12 15:55:50 +03:00
|
|
|
/** @var string */
|
|
|
|
private $note = '';
|
2015-10-30 15:09:07 +03:00
|
|
|
/** @var \DateTime */
|
|
|
|
private $expireDate;
|
|
|
|
/** @var string */
|
|
|
|
private $password;
|
2018-07-10 13:32:12 +03:00
|
|
|
/** @var bool */
|
|
|
|
private $sendPasswordByTalk = false;
|
2015-10-30 15:10:08 +03:00
|
|
|
/** @var string */
|
|
|
|
private $token;
|
|
|
|
/** @var int */
|
|
|
|
private $parent;
|
2015-11-02 23:06:55 +03:00
|
|
|
/** @var string */
|
|
|
|
private $target;
|
2016-01-27 22:51:26 +03:00
|
|
|
/** @var \DateTime */
|
2015-11-06 14:05:19 +03:00
|
|
|
private $shareTime;
|
|
|
|
/** @var bool */
|
|
|
|
private $mailSend;
|
2018-10-16 11:31:38 +03:00
|
|
|
/** @var string */
|
|
|
|
private $label = '';
|
2015-11-02 23:06:55 +03:00
|
|
|
|
2016-02-04 14:51:23 +03:00
|
|
|
/** @var IRootFolder */
|
|
|
|
private $rootFolder;
|
|
|
|
|
2016-05-11 21:48:27 +03:00
|
|
|
/** @var IUserManager */
|
|
|
|
private $userManager;
|
|
|
|
|
2016-11-17 16:18:47 +03:00
|
|
|
/** @var ICacheEntry|null */
|
|
|
|
private $nodeCacheEntry;
|
|
|
|
|
2018-10-15 09:47:07 +03:00
|
|
|
/** @var bool */
|
|
|
|
private $hideDownload = false;
|
|
|
|
|
2016-05-11 21:48:27 +03:00
|
|
|
public function __construct(IRootFolder $rootFolder, IUserManager $userManager) {
|
2016-02-04 14:51:23 +03:00
|
|
|
$this->rootFolder = $rootFolder;
|
2016-05-11 21:48:27 +03:00
|
|
|
$this->userManager = $userManager;
|
2016-02-04 14:51:23 +03:00
|
|
|
}
|
|
|
|
|
2015-10-30 15:09:07 +03:00
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
2015-10-30 15:10:08 +03:00
|
|
|
public function setId($id) {
|
2016-03-23 16:08:40 +03:00
|
|
|
if (is_int($id)) {
|
|
|
|
$id = (string)$id;
|
|
|
|
}
|
|
|
|
|
2020-04-10 15:19:56 +03:00
|
|
|
if (!is_string($id)) {
|
2016-03-23 16:08:40 +03:00
|
|
|
throw new \InvalidArgumentException('String expected.');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->id !== null) {
|
|
|
|
throw new IllegalIDChangeException('Not allowed to assign a new internal id to a share');
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->id = trim($id);
|
2015-10-30 15:09:07 +03:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function getId() {
|
2015-10-30 15:10:08 +03:00
|
|
|
return $this->id;
|
2015-10-30 15:09:07 +03:00
|
|
|
}
|
|
|
|
|
2016-01-13 15:02:23 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getFullId() {
|
2016-02-08 12:42:15 +03:00
|
|
|
if ($this->providerId === null || $this->id === null) {
|
2016-02-08 17:28:36 +03:00
|
|
|
throw new \UnexpectedValueException;
|
2016-02-08 12:42:15 +03:00
|
|
|
}
|
2016-01-13 15:02:23 +03:00
|
|
|
return $this->providerId . ':' . $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setProviderId($id) {
|
2020-04-10 15:19:56 +03:00
|
|
|
if (!is_string($id)) {
|
2016-03-23 16:08:40 +03:00
|
|
|
throw new \InvalidArgumentException('String expected.');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->providerId !== null) {
|
|
|
|
throw new IllegalIDChangeException('Not allowed to assign a new provider id to a share');
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->providerId = trim($id);
|
2016-01-13 15:02:23 +03:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-10-30 15:09:07 +03:00
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
2016-02-04 14:51:23 +03:00
|
|
|
public function setNode(Node $node) {
|
2016-02-04 11:53:47 +03:00
|
|
|
$this->fileId = null;
|
|
|
|
$this->nodeType = null;
|
2016-02-04 14:51:23 +03:00
|
|
|
$this->node = $node;
|
2015-10-30 15:09:07 +03:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
2016-01-27 22:51:26 +03:00
|
|
|
public function getNode() {
|
2016-02-04 14:51:23 +03:00
|
|
|
if ($this->node === null) {
|
|
|
|
if ($this->shareOwner === null || $this->fileId === null) {
|
|
|
|
throw new NotFoundException();
|
|
|
|
}
|
|
|
|
|
2016-05-11 21:48:27 +03:00
|
|
|
// for federated shares the owner can be a remote user, in this
|
|
|
|
// case we use the initiator
|
2020-04-10 15:19:56 +03:00
|
|
|
if ($this->userManager->userExists($this->shareOwner)) {
|
2016-05-11 21:48:27 +03:00
|
|
|
$userFolder = $this->rootFolder->getUserFolder($this->shareOwner);
|
|
|
|
} else {
|
|
|
|
$userFolder = $this->rootFolder->getUserFolder($this->sharedBy);
|
|
|
|
}
|
2016-02-04 14:51:23 +03:00
|
|
|
|
|
|
|
$nodes = $userFolder->getById($this->fileId);
|
|
|
|
if (empty($nodes)) {
|
2016-09-20 12:29:12 +03:00
|
|
|
throw new NotFoundException('Node for share not found, fileid: ' . $this->fileId);
|
2016-02-04 14:51:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
$this->node = $nodes[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->node;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setNodeId($fileId) {
|
|
|
|
$this->node = null;
|
|
|
|
$this->fileId = $fileId;
|
|
|
|
return $this;
|
2015-10-30 15:09:07 +03:00
|
|
|
}
|
|
|
|
|
2016-02-04 16:28:09 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getNodeId() {
|
|
|
|
if ($this->fileId === null) {
|
|
|
|
$this->fileId = $this->getNode()->getId();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->fileId;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setNodeType($type) {
|
|
|
|
if ($type !== 'file' && $type !== 'folder') {
|
|
|
|
throw new \InvalidArgumentException();
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->nodeType = $type;
|
2016-02-09 12:36:44 +03:00
|
|
|
return $this;
|
2016-02-04 16:28:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getNodeType() {
|
|
|
|
if ($this->nodeType === null) {
|
|
|
|
$node = $this->getNode();
|
|
|
|
$this->nodeType = $node instanceof File ? 'file' : 'folder';
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->nodeType;
|
|
|
|
}
|
|
|
|
|
2015-10-30 15:09:07 +03:00
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function setShareType($shareType) {
|
|
|
|
$this->shareType = $shareType;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function getShareType() {
|
|
|
|
return $this->shareType;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
2015-10-30 15:10:08 +03:00
|
|
|
public function setSharedWith($sharedWith) {
|
2016-02-02 18:55:41 +03:00
|
|
|
if (!is_string($sharedWith)) {
|
|
|
|
throw new \InvalidArgumentException();
|
|
|
|
}
|
2015-10-30 15:10:08 +03:00
|
|
|
$this->sharedWith = $sharedWith;
|
2015-10-30 15:09:07 +03:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
2015-10-30 15:10:08 +03:00
|
|
|
public function getSharedWith() {
|
|
|
|
return $this->sharedWith;
|
2015-10-30 15:09:07 +03:00
|
|
|
}
|
|
|
|
|
2017-06-06 14:21:42 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setSharedWithDisplayName($displayName) {
|
|
|
|
if (!is_string($displayName)) {
|
|
|
|
throw new \InvalidArgumentException();
|
|
|
|
}
|
|
|
|
$this->sharedWithDisplayName = $displayName;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getSharedWithDisplayName() {
|
|
|
|
return $this->sharedWithDisplayName;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setSharedWithAvatar($src) {
|
|
|
|
if (!is_string($src)) {
|
|
|
|
throw new \InvalidArgumentException();
|
|
|
|
}
|
|
|
|
$this->sharedWithAvatar = $src;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getSharedWithAvatar() {
|
|
|
|
return $this->sharedWithAvatar;
|
|
|
|
}
|
|
|
|
|
2015-10-30 15:09:07 +03:00
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function setPermissions($permissions) {
|
|
|
|
//TODO checkes
|
|
|
|
|
|
|
|
$this->permissions = $permissions;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function getPermissions() {
|
|
|
|
return $this->permissions;
|
|
|
|
}
|
|
|
|
|
2019-08-21 17:15:23 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setStatus(int $status): IShare {
|
|
|
|
$this->status = $status;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getStatus(): int {
|
|
|
|
return $this->status;
|
|
|
|
}
|
|
|
|
|
2018-07-12 15:55:50 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setNote($note) {
|
|
|
|
$this->note = $note;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getNote() {
|
2018-07-13 12:41:53 +03:00
|
|
|
if (is_string($this->note)) {
|
|
|
|
return $this->note;
|
|
|
|
}
|
|
|
|
return '';
|
2018-07-12 15:55:50 +03:00
|
|
|
}
|
|
|
|
|
2018-10-16 11:31:38 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setLabel($label) {
|
|
|
|
$this->label = $label;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getLabel() {
|
|
|
|
return $this->label;
|
|
|
|
}
|
|
|
|
|
2015-10-30 15:09:07 +03:00
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
2015-12-15 11:52:04 +03:00
|
|
|
public function setExpirationDate($expireDate) {
|
2015-10-30 15:09:07 +03:00
|
|
|
//TODO checks
|
|
|
|
|
|
|
|
$this->expireDate = $expireDate;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function getExpirationDate() {
|
|
|
|
return $this->expireDate;
|
|
|
|
}
|
|
|
|
|
2019-08-12 11:56:23 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function isExpired() {
|
|
|
|
return $this->getExpirationDate() !== null &&
|
|
|
|
$this->getExpirationDate() <= new \DateTime();
|
|
|
|
}
|
|
|
|
|
2015-10-30 15:09:07 +03:00
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function setSharedBy($sharedBy) {
|
2016-02-02 18:55:41 +03:00
|
|
|
if (!is_string($sharedBy)) {
|
|
|
|
throw new \InvalidArgumentException();
|
|
|
|
}
|
2015-10-30 15:09:07 +03:00
|
|
|
//TODO checks
|
|
|
|
$this->sharedBy = $sharedBy;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function getSharedBy() {
|
|
|
|
//TODO check if set
|
|
|
|
return $this->sharedBy;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function setShareOwner($shareOwner) {
|
2016-02-02 18:55:41 +03:00
|
|
|
if (!is_string($shareOwner)) {
|
|
|
|
throw new \InvalidArgumentException();
|
|
|
|
}
|
2015-10-30 15:09:07 +03:00
|
|
|
//TODO checks
|
|
|
|
|
|
|
|
$this->shareOwner = $shareOwner;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function getShareOwner() {
|
|
|
|
//TODO check if set
|
|
|
|
return $this->shareOwner;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
|
|
|
public function setPassword($password) {
|
|
|
|
$this->password = $password;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:09:07 +03:00
|
|
|
*/
|
2015-11-06 14:05:19 +03:00
|
|
|
public function getPassword() {
|
2015-10-30 15:09:07 +03:00
|
|
|
return $this->password;
|
|
|
|
}
|
2015-10-30 15:10:08 +03:00
|
|
|
|
2018-07-10 13:32:12 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setSendPasswordByTalk(bool $sendPasswordByTalk) {
|
|
|
|
$this->sendPasswordByTalk = $sendPasswordByTalk;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getSendPasswordByTalk(): bool {
|
|
|
|
return $this->sendPasswordByTalk;
|
|
|
|
}
|
|
|
|
|
2015-10-30 15:10:08 +03:00
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:10:08 +03:00
|
|
|
*/
|
|
|
|
public function setToken($token) {
|
|
|
|
$this->token = $token;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-10-30 15:10:08 +03:00
|
|
|
*/
|
|
|
|
public function getToken() {
|
|
|
|
return $this->token;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-11 13:30:52 +03:00
|
|
|
* Set the parent of this share
|
|
|
|
*
|
|
|
|
* @param int parent
|
|
|
|
* @return \OCP\Share\IShare
|
|
|
|
* @deprecated The new shares do not have parents. This is just here for legacy reasons.
|
2015-10-30 15:10:08 +03:00
|
|
|
*/
|
|
|
|
public function setParent($parent) {
|
|
|
|
$this->parent = $parent;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-02-11 13:30:52 +03:00
|
|
|
* Get the parent of this share.
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
* @deprecated The new shares do not have parents. This is just here for legacy reasons.
|
2015-10-30 15:10:08 +03:00
|
|
|
*/
|
|
|
|
public function getParent() {
|
|
|
|
return $this->parent;
|
|
|
|
}
|
2015-11-02 23:06:55 +03:00
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-11-02 23:06:55 +03:00
|
|
|
*/
|
|
|
|
public function setTarget($target) {
|
|
|
|
$this->target = $target;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-11-02 23:06:55 +03:00
|
|
|
*/
|
|
|
|
public function getTarget() {
|
|
|
|
return $this->target;
|
|
|
|
}
|
2015-11-06 14:05:19 +03:00
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-11-06 14:05:19 +03:00
|
|
|
*/
|
2016-01-27 22:51:26 +03:00
|
|
|
public function setShareTime(\DateTime $shareTime) {
|
2015-11-06 14:05:19 +03:00
|
|
|
$this->shareTime = $shareTime;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-11-06 14:05:19 +03:00
|
|
|
*/
|
2016-01-27 13:50:49 +03:00
|
|
|
public function getShareTime() {
|
2015-11-06 14:05:19 +03:00
|
|
|
return $this->shareTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-11-06 14:05:19 +03:00
|
|
|
*/
|
|
|
|
public function setMailSend($mailSend) {
|
|
|
|
$this->mailSend = $mailSend;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-01-27 13:50:49 +03:00
|
|
|
* @inheritdoc
|
2015-11-06 14:05:19 +03:00
|
|
|
*/
|
|
|
|
public function getMailSend() {
|
|
|
|
return $this->mailSend;
|
|
|
|
}
|
2016-11-17 16:18:47 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function setNodeCacheEntry(ICacheEntry $entry) {
|
|
|
|
$this->nodeCacheEntry = $entry;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
public function getNodeCacheEntry() {
|
|
|
|
return $this->nodeCacheEntry;
|
|
|
|
}
|
2018-10-15 09:47:07 +03:00
|
|
|
|
|
|
|
public function setHideDownload(bool $hide): IShare {
|
|
|
|
$this->hideDownload = $hide;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHideDownload(): bool {
|
|
|
|
return $this->hideDownload;
|
|
|
|
}
|
2015-10-30 15:09:07 +03:00
|
|
|
}
|