Code Duplication    Length = 10-10 lines in 2 locations

apps/files_sharing/lib/SharedStorage.php 2 locations

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