|
@@ 377-386 (lines=10) @@
|
| 374 |
|
* @param \OCP\Lock\ILockingProvider $provider |
| 375 |
|
* @throws \OCP\Lock\LockedException |
| 376 |
|
*/ |
| 377 |
|
public function acquireLock($path, $type, ILockingProvider $provider) { |
| 378 |
|
/** @var \OCP\Files\Storage\IStorage $targetStorage */ |
| 379 |
|
list($targetStorage, $targetInternalPath) = $this->resolvePath($path); |
| 380 |
|
$targetStorage->acquireLock($targetInternalPath, $type, $provider); |
| 381 |
|
// lock the parent folders of the owner when locking the share as recipient |
| 382 |
|
if ($path === '') { |
| 383 |
|
$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId()); |
| 384 |
|
$this->ownerView->lockFile(\dirname($sourcePath), ILockingProvider::LOCK_SHARED, true); |
| 385 |
|
} |
| 386 |
|
} |
| 387 |
|
|
| 388 |
|
/** |
| 389 |
|
* @param string $path |
|
@@ 393-402 (lines=10) @@
|
| 390 |
|
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
| 391 |
|
* @param \OCP\Lock\ILockingProvider $provider |
| 392 |
|
*/ |
| 393 |
|
public function releaseLock($path, $type, ILockingProvider $provider) { |
| 394 |
|
/** @var \OCP\Files\Storage\IStorage $targetStorage */ |
| 395 |
|
list($targetStorage, $targetInternalPath) = $this->resolvePath($path); |
| 396 |
|
$targetStorage->releaseLock($targetInternalPath, $type, $provider); |
| 397 |
|
// unlock the parent folders of the owner when unlocking the share as recipient |
| 398 |
|
if ($path === '') { |
| 399 |
|
$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId()); |
| 400 |
|
$this->ownerView->unlockFile(\dirname($sourcePath), ILockingProvider::LOCK_SHARED, true); |
| 401 |
|
} |
| 402 |
|
} |
| 403 |
|
|
| 404 |
|
/** |
| 405 |
|
* @param string $path |