\OCP\ShareIShareProvider

Interface IShareProvider

Summary

Methods
Constants
identifier()
create()
update()
delete()
deleteFromSelf()
move()
getSharesBy()
getAllSharesBy()
getShareById()
getSharesByPath()
getSharedWith()
getShareByToken()
userDeleted()
groupDeleted()
userDeletedFromGroup()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

identifier()

identifier() : string

Return the identifier of this provider.

Returns

string —

Containing only [a-zA-Z0-9]

delete()

delete(\OCP\Share\IShare  $share) 

Delete a share

Parameters

\OCP\Share\IShare $share

deleteFromSelf()

deleteFromSelf(\OCP\Share\IShare  $share, string  $recipient) 

Unshare a file from self as recipient.

This may require special handling. If a user unshares a group share from their self then the original group share should still exist.

Parameters

\OCP\Share\IShare $share
string $recipient

UserId of the recipient

move()

move(\OCP\Share\IShare  $share, string  $recipient) : \OCP\Share\IShare

Move a share as a recipient.

This is updating the share target. Thus the mount point of the recipient. This may require special handling. If a user moves a group share the target should only be changed for them.

Parameters

\OCP\Share\IShare $share
string $recipient

userId of recipient

Returns

\OCP\Share\IShare

getSharesBy()

getSharesBy(string  $userId, integer  $shareType, \OCP\Files\Node|null  $node, boolean  $reshares, integer  $limit, integer  $offset) : array<mixed,\OCP\Share\IShare>

Get all shares by the given user

Parameters

string $userId
integer $shareType
\OCP\Files\Node|null $node
boolean $reshares

Also get the shares where $user is the owner instead of just the shares where $user is the initiator

integer $limit

The maximum number of shares to be returned, -1 for all shares

integer $offset

Returns

array<mixed,\OCP\Share\IShare>

getAllSharesBy()

getAllSharesBy(string  $userId, array<mixed,integer>  $shareTypes, array<mixed,\OCP\Files\Node>  $nodeIDs, boolean  $reshares) : array<mixed,\OCP\Share\IShare>

Get all shares by the given user for specified shareTypes array

Parameters

string $userId
array<mixed,integer> $shareTypes
array<mixed,\OCP\Files\Node> $nodeIDs
boolean $reshares
  • Also get the shares where $user is the owner instead of just the shares where $user is the initiator

Returns

array<mixed,\OCP\Share\IShare>

getShareById()

getShareById(integer  $id, string|null  $recipientId = null) : \OCP\Share\IShare

Get share by id

Parameters

integer $id
string|null $recipientId

Throws

\OCP\Share\Exceptions\ShareNotFound
\OCP\Share\ProviderException

Returns

\OCP\Share\IShare

getSharesByPath()

getSharesByPath(\OCP\Files\Node  $path) : array<mixed,\OCP\Share\IShare>

Get shares for a given path

Parameters

\OCP\Files\Node $path

Returns

array<mixed,\OCP\Share\IShare>

getSharedWith()

getSharedWith(string  $userId, integer  $shareType, \OCP\Files\Node|null  $node, integer  $limit, integer  $offset) : array<mixed,\OCP\Share\IShare>

Get shared with the given user

Parameters

string $userId

get shares where this user is the recipient

integer $shareType
\OCP\Files\Node|null $node
integer $limit

The max number of entries returned, -1 for all

integer $offset

Returns

array<mixed,\OCP\Share\IShare>

getShareByToken()

getShareByToken(string  $token) : \OCP\Share\IShare

Get a share by token

Parameters

string $token

Throws

\OCP\Share\Exceptions\ShareNotFound

Returns

\OCP\Share\IShare

userDeleted()

userDeleted(string  $uid, integer  $shareType) 

A user is deleted from the system So clean up the relevant shares.

Parameters

string $uid
integer $shareType

groupDeleted()

groupDeleted(string  $gid) 

A group is deleted from the system.

We have to clean up all shares to this group. Providers not handling group shares should just return

Parameters

string $gid

userDeletedFromGroup()

userDeletedFromGroup(string  $uid, string  $gid) 

A user is deleted from a group We have to clean up all the related user specific group shares Providers not handling group shares should just return

Parameters

string $uid
string $gid