Code Duplication    Length = 10-10 lines in 2 locations

apps/files_sharing/lib/sharedstorage.php 2 locations

@@ 362-371 (lines=10) @@
359
	 * @param \OCP\Lock\ILockingProvider $provider
360
	 * @throws \OCP\Lock\LockedException
361
	 */
362
	public function acquireLock($path, $type, ILockingProvider $provider) {
363
		/** @var \OCP\Files\Storage $targetStorage */
364
		list($targetStorage, $targetInternalPath) = $this->resolvePath($path);
365
		$targetStorage->acquireLock($targetInternalPath, $type, $provider);
366
		// lock the parent folders of the owner when locking the share as recipient
367
		if ($path === '') {
368
			$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId());
369
			$this->ownerView->lockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true);
370
		}
371
	}
372
373
	/**
374
	 * @param string $path
@@ 378-387 (lines=10) @@
375
	 * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
376
	 * @param \OCP\Lock\ILockingProvider $provider
377
	 */
378
	public function releaseLock($path, $type, ILockingProvider $provider) {
379
		/** @var \OCP\Files\Storage $targetStorage */
380
		list($targetStorage, $targetInternalPath) = $this->resolvePath($path);
381
		$targetStorage->releaseLock($targetInternalPath, $type, $provider);
382
		// unlock the parent folders of the owner when unlocking the share as recipient
383
		if ($path === '') {
384
			$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId());
385
			$this->ownerView->unlockFile(dirname($sourcePath), ILockingProvider::LOCK_SHARED, true);
386
		}
387
	}
388
389
	/**
390
	 * @param string $path