IShare

interface OCP\Share\IShare
Interface IShare
Implemented by:OC\Share20\Share
Source:lib/public/Share/IShare.php#44

Constants

TYPE_USER = 0
Source:lib/public/Share/IShare.php#49
Since:17.0.0
TYPE_GROUP = 1
Source:lib/public/Share/IShare.php#54
Since:17.0.0
TYPE_USERGROUP = 2
Source:lib/public/Share/IShare.php#60
Since:18.0.0
TYPE_LINK = 3
Source:lib/public/Share/IShare.php#65
Since:17.0.0
TYPE_EMAIL = 4
Source:lib/public/Share/IShare.php#70
Since:17.0.0
TYPE_REMOTE = 6
Source:lib/public/Share/IShare.php#81
Since:17.0.0
TYPE_CIRCLE = 7
Source:lib/public/Share/IShare.php#86
Since:17.0.0
TYPE_GUEST = 8
Source:lib/public/Share/IShare.php#91
Since:17.0.0
TYPE_REMOTE_GROUP = 9
Source:lib/public/Share/IShare.php#96
Since:17.0.0
TYPE_ROOM = 10
Source:lib/public/Share/IShare.php#101
Since:17.0.0
TYPE_DECK = 12
Source:lib/public/Share/IShare.php#112
Since:21.0.0
TYPE_DECK_USER = 13
Source:lib/public/Share/IShare.php#118
Since:21.0.0
STATUS_PENDING = 0
Source:lib/public/Share/IShare.php#123
Since:18.0.0
STATUS_ACCEPTED = 1
Source:lib/public/Share/IShare.php#128
Since:18.0.0
STATUS_REJECTED = 2
Source:lib/public/Share/IShare.php#133
Since:18.0.0

Methods

public OCP\Share\IShare::setId($id)
Set the internal id of the share
It is only allowed to set the internal id of a share once.
Attempts to override the internal id will result in an IllegalIDChangeException
Source:

lib/public/Share/IShare.php#146

Parameters:
  • $id (string)
Returns:

\OCP\Share\IShare

Throws:

\OCP\Share\Exceptions\IllegalIDChangeException

Throws:

\InvalidArgumentException

Throws:

\OCP\Share\Exceptions\IllegalIDChangeException

Throws:

\InvalidArgumentException

Since:

9.1.0

public OCP\Share\IShare::getId()
Get the internal id of the share.
Source:lib/public/Share/IShare.php#154
Returns:string
Since:9.0.0
public OCP\Share\IShare::getFullId()
Get the full share id. This is the <providerid>:<internalid>.
The full id is unique in the system.
Source:lib/public/Share/IShare.php#164
Returns:string
Since:9.0.0
Throws:\UnexpectedValueException If the fullId could not be constructed
public OCP\Share\IShare::setProviderId($id)
Set the provider id of the share
It is only allowed to set the provider id of a share once.
Attempts to override the provider id will result in an IllegalIDChangeException
Source:

lib/public/Share/IShare.php#177

Parameters:
  • $id (string)
Returns:

\OCP\Share\IShare

Throws:

\OCP\Share\Exceptions\IllegalIDChangeException

Throws:

\InvalidArgumentException

Throws:

\OCP\Share\Exceptions\IllegalIDChangeException

Throws:

\InvalidArgumentException

Since:

9.1.0

public OCP\Share\IShare::setNode($node)
Set the node of the file/folder that is shared
Source:

lib/public/Share/IShare.php#186

Parameters:
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getNode()
Get the node of the file/folder that is shared
Source:lib/public/Share/IShare.php#195
Returns:\OCP\Files\File | \OCP\Files\Folder
Since:9.0.0
Throws:\OCP\Files\NotFoundException
public OCP\Share\IShare::setNodeId($fileId)
Set file id for lazy evaluation of the node
Source:

lib/public/Share/IShare.php#203

Parameters:
  • $fileId (int)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getNodeId()
Get the fileid of the node of this share
Source:lib/public/Share/IShare.php#211
Returns:int
Since:9.0.0
Throws:\OCP\Files\NotFoundException
public OCP\Share\IShare::setNodeType($type)
Set the type of node (file/folder)
Source:

lib/public/Share/IShare.php#220

Parameters:
  • $type (string)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getNodeType()
Get the type of node (file/folder)
Source:lib/public/Share/IShare.php#229
Returns:string
Since:9.0.0
Throws:\OCP\Files\NotFoundException
public OCP\Share\IShare::setShareType($shareType)
Set the shareType
Source:

lib/public/Share/IShare.php#238

Parameters:
  • $shareType (int)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getShareType()
Get the shareType
Source:lib/public/Share/IShare.php#246
Returns:int
Since:9.0.0
public OCP\Share\IShare::setSharedWith($sharedWith)
Set the receiver of this share.
Source:

lib/public/Share/IShare.php#255

Parameters:
  • $sharedWith (string)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getSharedWith()
Get the receiver of this share.
Source:lib/public/Share/IShare.php#263
Returns:string
Since:9.0.0
public OCP\Share\IShare::setSharedWithDisplayName($displayName)
Set the display name of the receiver of this share.
Source:

lib/public/Share/IShare.php#272

Parameters:
  • $displayName (string)
Returns:

\OCP\Share\IShare The modified object

Since:

14.0.0

public OCP\Share\IShare::getSharedWithDisplayName()
Get the display name of the receiver of this share.
Source:lib/public/Share/IShare.php#280
Returns:string
Since:14.0.0
public OCP\Share\IShare::setSharedWithAvatar($src)
Set the avatar of the receiver of this share.
Source:

lib/public/Share/IShare.php#289

Parameters:
  • $src (string)
Returns:

\OCP\Share\IShare The modified object

Since:

14.0.0

public OCP\Share\IShare::getSharedWithAvatar()
Get the avatar of the receiver of this share.
Source:lib/public/Share/IShare.php#297
Returns:string
Since:14.0.0
public OCP\Share\IShare::setPermissions($permissions)
Set the permissions.
See \OCP\Constants::PERMISSION_*
Source:

lib/public/Share/IShare.php#307

Parameters:
  • $permissions (int)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getPermissions()
Get the share permissions
See \OCP\Constants::PERMISSION_*
Source:lib/public/Share/IShare.php#316
Returns:int
Since:9.0.0
public OCP\Share\IShare::setStatus($status)
Set the accepted status
See self::STATUS_*
Source:

lib/public/Share/IShare.php#326

Parameters:
  • $status (int)
Returns:

\OCP\Share\IShare The modified object

Since:

18.0.0

public OCP\Share\IShare::getStatus()
Get the accepted status
See self::STATUS_*
Source:lib/public/Share/IShare.php#335
Returns:int
Since:18.0.0
public OCP\Share\IShare::setNote($note)
Attach a note to a share
Source:

lib/public/Share/IShare.php#344

Parameters:
  • $note (string)
Returns:

\OCP\Share\IShare The modified object

Since:

14.0.0

public OCP\Share\IShare::getNote()
Get note attached to a share
Source:lib/public/Share/IShare.php#352
Returns:string
Since:14.0.0
public OCP\Share\IShare::setExpirationDate($expireDate)
Set the expiration date
Source:

lib/public/Share/IShare.php#362

Parameters:
  • $expireDate (null | \DateTime)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getExpirationDate()
Get the expiration date
Source:lib/public/Share/IShare.php#370
Returns:\DateTime
Since:9.0.0
public OCP\Share\IShare::isExpired()
Is the share expired ?
Source:lib/public/Share/IShare.php#378
Returns:bool
Since:18.0.0
public OCP\Share\IShare::setLabel($label)
set a label for a share, some shares, e.g. public links can have a label
Source:

lib/public/Share/IShare.php#387

Parameters:
  • $label (string)
Returns:

\OCP\Share\IShare The modified object

Since:

15.0.0

public OCP\Share\IShare::getLabel()
get label for the share, some shares, e.g. public links can have a label
Source:lib/public/Share/IShare.php#395
Returns:string
Since:15.0.0
public OCP\Share\IShare::setSharedBy($sharedBy)
Set the sharer of the path.
Source:

lib/public/Share/IShare.php#404

Parameters:
  • $sharedBy (string)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getSharedBy()
Get share sharer
Source:lib/public/Share/IShare.php#412
Returns:string
Since:9.0.0
public OCP\Share\IShare::setShareOwner($shareOwner)
Set the original share owner (who owns the path that is shared)
Source:

lib/public/Share/IShare.php#421

Parameters:
  • $shareOwner (string)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getShareOwner()
Get the original share owner (who owns the path that is shared)
Source:lib/public/Share/IShare.php#429
Returns:string
Since:9.0.0
public OCP\Share\IShare::setPassword($password)
Set the password for this share.
When the share is passed to the share manager to be created
or updated the password will be hashed.
Source:

lib/public/Share/IShare.php#440

Parameters:
  • $password (string | null)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getPassword()
Get the password of this share.
If this share is obtained via a shareprovider the password is
hashed.
Source:lib/public/Share/IShare.php#450
Returns:string
Since:9.0.0
public OCP\Share\IShare::setSendPasswordByTalk($sendPasswordByTalk)
Set if the recipient can start a conversation with the owner to get the
password using Nextcloud Talk.
Source:

lib/public/Share/IShare.php#461

Parameters:
  • $sendPasswordByTalk (bool)
Returns:

\OCP\Share\IShare The modified object

Since:

14.0.0

public OCP\Share\IShare::getSendPasswordByTalk()
Get if the recipient can start a conversation with the owner to get the
password using Nextcloud Talk.
The returned value does not take into account other factors, like Talk
being enabled for the owner of the share or not; it just cover whether
the option is enabled for the share itself or not.
Source:lib/public/Share/IShare.php#473
Returns:bool
Since:14.0.0
public OCP\Share\IShare::setToken($token)
Set the public link token.
Source:

lib/public/Share/IShare.php#482

Parameters:
  • $token (string)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getToken()
Get the public link token.
Source:lib/public/Share/IShare.php#490
Returns:string
Since:9.0.0
public OCP\Share\IShare::setTarget($target)
Set the target path of this share relative to the recipients user folder.
Source:

lib/public/Share/IShare.php#499

Parameters:
  • $target (string)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getTarget()
Get the target path of this share relative to the recipients user folder.
Source:lib/public/Share/IShare.php#507
Returns:string
Since:9.0.0
public OCP\Share\IShare::setShareTime($shareTime)
Set the time this share was created
Source:

lib/public/Share/IShare.php#516

Parameters:
  • $shareTime (DateTime)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getShareTime()
Get the timestamp this share was created
Source:lib/public/Share/IShare.php#524
Returns:\DateTime
Since:9.0.0
public OCP\Share\IShare::setMailSend($mailSend)
Set if the recipient is informed by mail about the share.
Source:

lib/public/Share/IShare.php#533

Parameters:
  • $mailSend (bool)
Returns:

\OCP\Share\IShare The modified object

Since:

9.0.0

public OCP\Share\IShare::getMailSend()
Get if the recipient informed by mail about the share.
Source:lib/public/Share/IShare.php#541
Returns:bool
Since:9.0.0
public OCP\Share\IShare::setNodeCacheEntry($entry)
Set the cache entry for the shared node
Source:

lib/public/Share/IShare.php#549

Parameters:
Since:

11.0.0

public OCP\Share\IShare::getNodeCacheEntry()
Get the cache entry for the shared node
Source:lib/public/Share/IShare.php#557
Returns:null | \OCP\Files\Cache\ICacheEntry
Since:11.0.0
public OCP\Share\IShare::setHideDownload($hide)
Sets a shares hide download state
This is mainly for public shares. It will signal that the share page should
hide download buttons etc.
Source:

lib/public/Share/IShare.php#568

Parameters:
  • $hide (bool)
Returns:

\OCP\Share\IShare

Since:

15.0.0

public OCP\Share\IShare::getHideDownload()
Gets a shares hide download state
This is mainly for public shares. It will signal that the share page should
hide download buttons etc.
Source:lib/public/Share/IShare.php#578
Returns:bool
Since:15.0.0