Code Duplication    Length = 16-16 lines in 2 locations

lib/private/Files/View.php 2 locations

@@ 1986-2001 (lines=16) @@
1983
	 *
1984
	 * @return bool False if the path is excluded from locking, true otherwise
1985
	 */
1986
	public function lockFile($path, $type, $lockMountPoint = false) {
1987
		$absolutePath = $this->getAbsolutePath($path);
1988
		$absolutePath = Filesystem::normalizePath($absolutePath);
1989
		if (!$this->shouldLockFile($absolutePath)) {
1990
			return false;
1991
		}
1992
1993
		$this->lockPath($path, $type, $lockMountPoint);
1994
1995
		$parents = $this->getParents($path);
1996
		foreach ($parents as $parent) {
1997
			$this->lockPath($parent, ILockingProvider::LOCK_SHARED);
1998
		}
1999
2000
		return true;
2001
	}
2002
2003
	/**
2004
	 * Unlock a path and all its parents up to the root of the view
@@ 2012-2027 (lines=16) @@
2009
	 *
2010
	 * @return bool False if the path is excluded from locking, true otherwise
2011
	 */
2012
	public function unlockFile($path, $type, $lockMountPoint = false) {
2013
		$absolutePath = $this->getAbsolutePath($path);
2014
		$absolutePath = Filesystem::normalizePath($absolutePath);
2015
		if (!$this->shouldLockFile($absolutePath)) {
2016
			return false;
2017
		}
2018
2019
		$this->unlockPath($path, $type, $lockMountPoint);
2020
2021
		$parents = $this->getParents($path);
2022
		foreach ($parents as $parent) {
2023
			$this->unlockPath($parent, ILockingProvider::LOCK_SHARED);
2024
		}
2025
2026
		return true;
2027
	}
2028
2029
	/**
2030
	 * Only lock files in data/user/files/