Code Duplication    Length = 10-10 lines in 2 locations

apps/files_sharing/lib/sharedstorage.php 2 locations

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