IShareProvider

interface OCP\Share\IShareProvider
Interface IShareProvider
Implemented by:OC\Share20\DefaultShareProvider
Source:lib/public/Share/IShareProvider.php#39

Methods

public OCP\Share\IShareProvider::identifier()
Return the identifier of this provider.
Source:lib/public/Share/IShareProvider.php#47
Returns:string Containing only [a-zA-Z0-9]
Since:9.0.0
public OCP\Share\IShareProvider::create($share)
Create a share
Source:

lib/public/Share/IShareProvider.php#56

Parameters:
Returns:

\OCP\Share\IShare The share object

Since:

9.0.0

public OCP\Share\IShareProvider::update($share)
Update a share
Source:

lib/public/Share/IShareProvider.php#65

Parameters:
Returns:

\OCP\Share\IShare The share object

Since:

9.0.0

public OCP\Share\IShareProvider::delete($share)
Delete a share
Source:

lib/public/Share/IShareProvider.php#83

Parameters:
Since:

9.0.0

public OCP\Share\IShareProvider::deleteFromSelf($share, $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.
Source:

lib/public/Share/IShareProvider.php#94

Parameters:
Since:

9.0.0

public OCP\Share\IShareProvider::restore($share, $recipient)
Restore a share for a given recipient. The implementation could be provider independant.
Source:

lib/public/Share/IShareProvider.php#106

Parameters:
Returns:

\OCP\Share\IShare The restored share object

Since:

14.0.0

Throws:

\OCP\Share\Exceptions\GenericShareException In case the share could not be restored

public OCP\Share\IShareProvider::move($share, $recipient)
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.
Source:

lib/public/Share/IShareProvider.php#119

Parameters:
Returns:

\OCP\Share\IShare

Since:

9.0.0

public OCP\Share\IShareProvider::getSharesInFolder($userId, $node, $reshares)
Get all shares by the given user in a folder
Source:

lib/public/Share/IShareProvider.php#130

Parameters:
  • $userId (string)
  • $node (OCP\Files\Folder)
  • $reshares (bool) Also get the shares where $user is the owner instead of just the shares where $user is the initiator
Returns:

\OCP\Share\IShare[][]

Since:

11.0.0

public OCP\Share\IShareProvider::getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset)
Get all shares by the given user
Source:

lib/public/Share/IShareProvider.php#144

Parameters:
  • $userId (string)
  • $shareType (int)
  • $node (OCP\Files\Node | null)
  • $reshares (bool) Also get the shares where $user is the owner instead of just the shares where $user is the initiator
  • $limit (int) The maximum number of shares to be returned, -1 for all shares
  • $offset (int)
Returns:

\OCP\Share\IShare[]

Since:

9.0.0

public OCP\Share\IShareProvider::getShareById($id, $recipientId=null)
Get share by id
Source:

lib/public/Share/IShareProvider.php#155

Parameters:
  • $id (int)
  • $recipientId (string | null)
Returns:

\OCP\Share\IShare

Throws:

\OCP\Share\Exceptions\ShareNotFound

Since:

9.0.0

public OCP\Share\IShareProvider::getSharesByPath($path)
Get shares for a given path
Source:

lib/public/Share/IShareProvider.php#164

Parameters:
Returns:

\OCP\Share\IShare[]

Since:

9.0.0

public OCP\Share\IShareProvider::getSharedWith($userId, $shareType, $node, $limit, $offset)
Get shared with the given user
Source:

lib/public/Share/IShareProvider.php#177

Parameters:
  • $userId (string) get shares where this user is the recipient
  • $shareType (int)
  • $node (OCP\Files\Node | null)
  • $limit (int) The max number of entries returned, -1 for all
  • $offset (int)
Returns:

\OCP\Share\IShare[]

Since:

9.0.0

public OCP\Share\IShareProvider::getShareByToken($token)
Get a share by token
Source:

lib/public/Share/IShareProvider.php#187

Parameters:
  • $token (string)
Returns:

\OCP\Share\IShare

Throws:

\OCP\Share\Exceptions\ShareNotFound

Since:

9.0.0

public OCP\Share\IShareProvider::userDeleted($uid, $shareType)
A user is deleted from the system
So clean up the relevant shares.
Source:

lib/public/Share/IShareProvider.php#197

Parameters:
  • $uid (string)
  • $shareType (int)
Since:

9.1.0

public OCP\Share\IShareProvider::groupDeleted($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
Source:

lib/public/Share/IShareProvider.php#207

Parameters:
  • $gid (string)
Since:

9.1.0

public OCP\Share\IShareProvider::userDeletedFromGroup($uid, $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
Source:

lib/public/Share/IShareProvider.php#218

Parameters:
  • $uid (string)
  • $gid (string)
Since:

9.1.0

public OCP\Share\IShareProvider::getAccessList($nodes, $currentAccess)
Get the access list to the array of provided nodes.
Source:

lib/public/Share/IShareProvider.php#230

Parameters:
  • $nodes (OCP\Files\Node[]) The list of nodes to get access for
  • $currentAccess (bool) If current access is required (like for removed shares that might get revived later)
See:

\OCP\Share\IManager::getAccessList() for sample docs

Returns:

array

Since:

12

public OCP\Share\IShareProvider::getAllShares()
Get all the shares in this provider returned as iterable to reduce memory
overhead
Source:lib/public/Share/IShareProvider.php#239
Returns:iterable
Since:18.0.0