Code Duplication    Length = 10-10 lines in 2 locations

apps/files_sharing/lib/sharedstorage.php 2 locations

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