summaryrefslogtreecommitdiffstats
path: root/lib/private/connector
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-07-22 15:12:36 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-14 20:35:33 +0200
commit209abaadbb6bf6c5b375a11f61e61fe47fb9b917 (patch)
treed01e98f58c40707d831e5c71f99e96b35aefc4b0 /lib/private/connector
parentfb9e75edb6d01729a27c84f6f11399a1b0fde9f3 (diff)
downloadnextcloud-server-209abaadbb6bf6c5b375a11f61e61fe47fb9b917.tar.gz
nextcloud-server-209abaadbb6bf6c5b375a11f61e61fe47fb9b917.zip
expose locking api in sabre connector
Diffstat (limited to 'lib/private/connector')
-rw-r--r--lib/private/connector/sabre/node.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php
index 7f4bf8ffed1..30faf9941bd 100644
--- a/lib/private/connector/sabre/node.php
+++ b/lib/private/connector/sabre/node.php
@@ -67,6 +67,7 @@ abstract class Node implements \Sabre\DAV\INode {
/**
* Sets up the node, expects a full path name
+ *
* @param \OC\Files\View $view
* @param \OCP\Files\FileInfo $info
*/
@@ -82,6 +83,7 @@ abstract class Node implements \Sabre\DAV\INode {
/**
* Returns the name of the node
+ *
* @return string
*/
public function getName() {
@@ -99,6 +101,7 @@ abstract class Node implements \Sabre\DAV\INode {
/**
* Renames the node
+ *
* @param string $name The new name
* @throws \Sabre\DAV\Exception\BadRequest
* @throws \Sabre\DAV\Exception\Forbidden
@@ -131,6 +134,7 @@ abstract class Node implements \Sabre\DAV\INode {
/**
* Returns the last modification time, as a unix timestamp
+ *
* @return int timestamp as integer
*/
public function getLastModified() {
@@ -212,7 +216,7 @@ abstract class Node implements \Sabre\DAV\INode {
* @return string|null
*/
public function getDavPermissions() {
- $p ='';
+ $p = '';
if ($this->info->isShared()) {
$p .= 'S';
}
@@ -248,4 +252,25 @@ abstract class Node implements \Sabre\DAV\INode {
throw new InvalidPath($ex->getMessage());
}
}
+
+ /**
+ * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
+ */
+ public function acquireLock($type) {
+ $this->fileView->lockFile($this->path, $type);
+ }
+
+ /**
+ * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
+ */
+ public function releaseLock($type) {
+ $this->fileView->unlockFile($this->path, $type);
+ }
+
+ /**
+ * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
+ */
+ public function changeLock($type) {
+ $this->fileView->changeLock($this->path, $type);
+ }
}