Code Duplication    Length = 10-10 lines in 2 locations

apps/files_sharing/lib/SharedStorage.php 2 locations

@@ 401-410 (lines=10) @@
398
	 * @param \OCP\Lock\ILockingProvider $provider
399
	 * @throws \OCP\Lock\LockedException
400
	 */
401
	public function acquireLock($path, $type, ILockingProvider $provider) {
402
		/** @var \OCP\Files\Storage $targetStorage */
403
		list($targetStorage, $targetInternalPath) = $this->resolvePath($path);
404
		$targetStorage->acquireLock($targetInternalPath, $type, $provider);
405
		// lock the parent folders of the owner when locking the share as recipient
406
		if ($path === '') {
407
			$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId());
408
			$this->ownerView->lockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true);
409
		}
410
	}
411
412
	/**
413
	 * @param string $path
@@ 417-426 (lines=10) @@
414
	 * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
415
	 * @param \OCP\Lock\ILockingProvider $provider
416
	 */
417
	public function releaseLock($path, $type, ILockingProvider $provider) {
418
		/** @var \OCP\Files\Storage $targetStorage */
419
		list($targetStorage, $targetInternalPath) = $this->resolvePath($path);
420
		$targetStorage->releaseLock($targetInternalPath, $type, $provider);
421
		// unlock the parent folders of the owner when unlocking the share as recipient
422
		if ($path === '') {
423
			$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId());
424
			$this->ownerView->unlockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true);
425
		}
426
	}
427
428
	/**
429
	 * @param string $path