|
@@ 683-692 (lines=10) @@
|
| 680 |
|
* @param \OCP\Lock\ILockingProvider $provider |
| 681 |
|
* @throws \OCP\Lock\LockedException |
| 682 |
|
*/ |
| 683 |
|
public function acquireLock($path, $type, ILockingProvider $provider) { |
| 684 |
|
/** @var \OCP\Files\Storage $targetStorage */ |
| 685 |
|
list($targetStorage, $targetInternalPath) = $this->resolvePath($path); |
| 686 |
|
$targetStorage->acquireLock($targetInternalPath, $type, $provider); |
| 687 |
|
// lock the parent folders of the owner when locking the share as recipient |
| 688 |
|
if ($path === '') { |
| 689 |
|
$sourcePath = $this->ownerView->getPath($this->share['file_source']); |
| 690 |
|
$this->ownerView->lockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true); |
| 691 |
|
} |
| 692 |
|
} |
| 693 |
|
|
| 694 |
|
/** |
| 695 |
|
* @param string $path |
|
@@ 699-708 (lines=10) @@
|
| 696 |
|
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
| 697 |
|
* @param \OCP\Lock\ILockingProvider $provider |
| 698 |
|
*/ |
| 699 |
|
public function releaseLock($path, $type, ILockingProvider $provider) { |
| 700 |
|
/** @var \OCP\Files\Storage $targetStorage */ |
| 701 |
|
list($targetStorage, $targetInternalPath) = $this->resolvePath($path); |
| 702 |
|
$targetStorage->releaseLock($targetInternalPath, $type, $provider); |
| 703 |
|
// unlock the parent folders of the owner when unlocking the share as recipient |
| 704 |
|
if ($path === '') { |
| 705 |
|
$sourcePath = $this->ownerView->getPath($this->share['file_source']); |
| 706 |
|
$this->ownerView->unlockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true); |
| 707 |
|
} |
| 708 |
|
} |
| 709 |
|
|
| 710 |
|
/** |
| 711 |
|
* @param string $path |