summaryrefslogtreecommitdiffstats
path: root/lib/private/files/node
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-03-03 13:45:48 +0100
committerRobin Appelman <icewind@owncloud.com>2016-03-03 13:47:00 +0100
commit02635c6f2fe9357c88aa896896aec036f92c8d87 (patch)
tree9abaf104c113522c7a290dae9c490fe9510d8175 /lib/private/files/node
parent4f25f341788b3edad1bf4baf739cd632785c9abb (diff)
downloadnextcloud-server-02635c6f2fe9357c88aa896896aec036f92c8d87.tar.gz
nextcloud-server-02635c6f2fe9357c88aa896896aec036f92c8d87.zip
Add locking to the node api
Diffstat (limited to 'lib/private/files/node')
-rw-r--r--lib/private/files/node/node.php24
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);
+ }
}