|
@@ 348-357 (lines=10) @@
|
| 345 |
|
* @param \OCP\Lock\ILockingProvider $provider |
| 346 |
|
* @throws \OCP\Lock\LockedException |
| 347 |
|
*/ |
| 348 |
|
public function acquireLock($path, $type, ILockingProvider $provider) { |
| 349 |
|
/** @var \OCP\Files\Storage $targetStorage */ |
| 350 |
|
list($targetStorage, $targetInternalPath) = $this->resolvePath($path); |
| 351 |
|
$targetStorage->acquireLock($targetInternalPath, $type, $provider); |
| 352 |
|
// lock the parent folders of the owner when locking the share as recipient |
| 353 |
|
if ($path === '') { |
| 354 |
|
$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId()); |
| 355 |
|
$this->ownerView->lockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true); |
| 356 |
|
} |
| 357 |
|
} |
| 358 |
|
|
| 359 |
|
/** |
| 360 |
|
* @param string $path |
|
@@ 364-373 (lines=10) @@
|
| 361 |
|
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
| 362 |
|
* @param \OCP\Lock\ILockingProvider $provider |
| 363 |
|
*/ |
| 364 |
|
public function releaseLock($path, $type, ILockingProvider $provider) { |
| 365 |
|
/** @var \OCP\Files\Storage $targetStorage */ |
| 366 |
|
list($targetStorage, $targetInternalPath) = $this->resolvePath($path); |
| 367 |
|
$targetStorage->releaseLock($targetInternalPath, $type, $provider); |
| 368 |
|
// unlock the parent folders of the owner when unlocking the share as recipient |
| 369 |
|
if ($path === '') { |
| 370 |
|
$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId()); |
| 371 |
|
$this->ownerView->unlockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true); |
| 372 |
|
} |
| 373 |
|
} |
| 374 |
|
|
| 375 |
|
/** |
| 376 |
|
* @param string $path |