Code Duplication    Length = 16-16 lines in 2 locations

lib/private/Files/View.php 2 locations

@@ 2001-2016 (lines=16) @@
1998
	 *
1999
	 * @return bool False if the path is excluded from locking, true otherwise
2000
	 */
2001
	public function lockFile($path, $type, $lockMountPoint = false) {
2002
		$absolutePath = $this->getAbsolutePath($path);
2003
		$absolutePath = Filesystem::normalizePath($absolutePath);
2004
		if (!$this->shouldLockFile($absolutePath)) {
2005
			return false;
2006
		}
2007
2008
		$this->lockPath($path, $type, $lockMountPoint);
2009
2010
		$parents = $this->getParents($path);
2011
		foreach ($parents as $parent) {
2012
			$this->lockPath($parent, ILockingProvider::LOCK_SHARED);
2013
		}
2014
2015
		return true;
2016
	}
2017
2018
	/**
2019
	 * Unlock a path and all its parents up to the root of the view
@@ 2027-2042 (lines=16) @@
2024
	 *
2025
	 * @return bool False if the path is excluded from locking, true otherwise
2026
	 */
2027
	public function unlockFile($path, $type, $lockMountPoint = false) {
2028
		$absolutePath = $this->getAbsolutePath($path);
2029
		$absolutePath = Filesystem::normalizePath($absolutePath);
2030
		if (!$this->shouldLockFile($absolutePath)) {
2031
			return false;
2032
		}
2033
2034
		$this->unlockPath($path, $type, $lockMountPoint);
2035
2036
		$parents = $this->getParents($path);
2037
		foreach ($parents as $parent) {
2038
			$this->unlockPath($parent, ILockingProvider::LOCK_SHARED);
2039
		}
2040
2041
		return true;
2042
	}
2043
2044
	/**
2045
	 * Only lock files in data/user/files/