From 536e187e5125aefec75037648181afc42df2a9d0 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 4 May 2015 14:21:34 +0200 Subject: add locking to the storage api --- lib/public/files/storage.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/public') diff --git a/lib/public/files/storage.php b/lib/public/files/storage.php index b89fb49a4be..ea1da575959 100644 --- a/lib/public/files/storage.php +++ b/lib/public/files/storage.php @@ -33,6 +33,7 @@ // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP\Files; use OCP\Files\InvalidPathException; +use OCP\Lock\ILockingProvider; /** * Provide a common interface to all different storage options @@ -413,4 +414,19 @@ interface Storage { * @since 8.1.0 */ public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath); + + /** + * @param string $path + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE + * @param \OCP\Lock\ILockingProvider $provider + * @throws \OCP\Lock\LockedException + */ + public function acquireLock($path, $type, ILockingProvider $provider); + + /** + * @param string $path + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE + * @param \OCP\Lock\ILockingProvider $provider + */ + public function releaseLock($path, $type, ILockingProvider $provider); } -- cgit v1.2.3