diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-07 14:43:49 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-07 14:43:49 +0100 |
commit | fa436b5b0c557abf46d6dcc919c9c2271ddedfcc (patch) | |
tree | d89253a648df203a7a387040f219e4431accc7b3 /lib/private/files | |
parent | e5b5eca5a96acd2001fd72d1cbb290de53186be0 (diff) | |
parent | 02635c6f2fe9357c88aa896896aec036f92c8d87 (diff) | |
download | nextcloud-server-fa436b5b0c557abf46d6dcc919c9c2271ddedfcc.tar.gz nextcloud-server-fa436b5b0c557abf46d6dcc919c9c2271ddedfcc.zip |
Merge pull request #22812 from owncloud/node-lock
Add locking to the node api
Diffstat (limited to 'lib/private/files')
-rw-r--r-- | lib/private/files/node/node.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/private/files/node/node.php b/lib/private/files/node/node.php index 5df4f738a42..c4fabfc2e2e 100644 --- a/lib/private/files/node/node.php +++ b/lib/private/files/node/node.php @@ -356,4 +356,28 @@ class Node implements \OCP\Files\Node { public function getChecksum() { return; } + + /** + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE + * @throws \OCP\Lock\LockedException + */ + public function lock($type) { + $this->view->lockFile($this->path, $type); + } + + /** + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE + * @throws \OCP\Lock\LockedException + */ + public function changeLock($type) { + $this->view->changeLock($this->path, $type); + } + + /** + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE + * @throws \OCP\Lock\LockedException + */ + public function unlock($type) { + $this->view->unlockFile($this->path, $type); + } } |