|
@@ 417-426 (lines=10) @@
|
| 414 |
|
* @param \OCP\Lock\ILockingProvider $provider |
| 415 |
|
* @throws \OCP\Lock\LockedException |
| 416 |
|
*/ |
| 417 |
|
public function acquireLock($path, $type, ILockingProvider $provider) { |
| 418 |
|
/** @var \OCP\Files\Storage $targetStorage */ |
| 419 |
|
list($targetStorage, $targetInternalPath) = $this->resolvePath($path); |
| 420 |
|
$targetStorage->acquireLock($targetInternalPath, $type, $provider); |
| 421 |
|
// lock the parent folders of the owner when locking the share as recipient |
| 422 |
|
if ($path === '') { |
| 423 |
|
$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId()); |
| 424 |
|
$this->ownerView->lockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true); |
| 425 |
|
} |
| 426 |
|
} |
| 427 |
|
|
| 428 |
|
/** |
| 429 |
|
* @param string $path |
|
@@ 433-442 (lines=10) @@
|
| 430 |
|
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
| 431 |
|
* @param \OCP\Lock\ILockingProvider $provider |
| 432 |
|
*/ |
| 433 |
|
public function releaseLock($path, $type, ILockingProvider $provider) { |
| 434 |
|
/** @var \OCP\Files\Storage $targetStorage */ |
| 435 |
|
list($targetStorage, $targetInternalPath) = $this->resolvePath($path); |
| 436 |
|
$targetStorage->releaseLock($targetInternalPath, $type, $provider); |
| 437 |
|
// unlock the parent folders of the owner when unlocking the share as recipient |
| 438 |
|
if ($path === '') { |
| 439 |
|
$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId()); |
| 440 |
|
$this->ownerView->unlockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true); |
| 441 |
|
} |
| 442 |
|
} |
| 443 |
|
|
| 444 |
|
/** |
| 445 |
|
* @param string $path |