Code Duplication    Length = 10-10 lines in 2 locations

apps/files_sharing/lib/sharedstorage.php 2 locations

@@ 651-660 (lines=10) @@
648
	 * @param \OCP\Lock\ILockingProvider $provider
649
	 * @throws \OCP\Lock\LockedException
650
	 */
651
	public function acquireLock($path, $type, ILockingProvider $provider) {
652
		/** @var \OCP\Files\Storage $targetStorage */
653
		list($targetStorage, $targetInternalPath) = $this->resolvePath($path);
654
		$targetStorage->acquireLock($targetInternalPath, $type, $provider);
655
		// lock the parent folders of the owner when locking the share as recipient
656
		if ($path === '') {
657
			$sourcePath = $this->ownerView->getPath($this->share['file_source']);
658
			$this->ownerView->lockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true);
659
		}
660
	}
661
662
	/**
663
	 * @param string $path
@@ 667-676 (lines=10) @@
664
	 * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
665
	 * @param \OCP\Lock\ILockingProvider $provider
666
	 */
667
	public function releaseLock($path, $type, ILockingProvider $provider) {
668
		/** @var \OCP\Files\Storage $targetStorage */
669
		list($targetStorage, $targetInternalPath) = $this->resolvePath($path);
670
		$targetStorage->releaseLock($targetInternalPath, $type, $provider);
671
		// unlock the parent folders of the owner when unlocking the share as recipient
672
		if ($path === '') {
673
			$sourcePath = $this->ownerView->getPath($this->share['file_source']);
674
			$this->ownerView->unlockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true);
675
		}
676
	}
677
678
	/**
679
	 * @param string $path