Code Duplication    Length = 16-16 lines in 2 locations

lib/private/Files/View.php 2 locations

@@ 2055-2070 (lines=16) @@
2052
	 *
2053
	 * @return bool False if the path is excluded from locking, true otherwise
2054
	 */
2055
	public function lockFile($path, $type, $lockMountPoint = false) {
2056
		$absolutePath = $this->getAbsolutePath($path);
2057
		$absolutePath = Filesystem::normalizePath($absolutePath);
2058
		if (!$this->shouldLockFile($absolutePath)) {
2059
			return false;
2060
		}
2061
2062
		$this->lockPath($path, $type, $lockMountPoint);
2063
2064
		$parents = $this->getParents($path);
2065
		foreach ($parents as $parent) {
2066
			$this->lockPath($parent, ILockingProvider::LOCK_SHARED);
2067
		}
2068
2069
		return true;
2070
	}
2071
2072
	/**
2073
	 * Unlock a path and all its parents up to the root of the view
@@ 2081-2096 (lines=16) @@
2078
	 *
2079
	 * @return bool False if the path is excluded from locking, true otherwise
2080
	 */
2081
	public function unlockFile($path, $type, $lockMountPoint = false) {
2082
		$absolutePath = $this->getAbsolutePath($path);
2083
		$absolutePath = Filesystem::normalizePath($absolutePath);
2084
		if (!$this->shouldLockFile($absolutePath)) {
2085
			return false;
2086
		}
2087
2088
		$this->unlockPath($path, $type, $lockMountPoint);
2089
2090
		$parents = $this->getParents($path);
2091
		foreach ($parents as $parent) {
2092
			$this->unlockPath($parent, ILockingProvider::LOCK_SHARED);
2093
		}
2094
2095
		return true;
2096
	}
2097
2098
	/**
2099
	 * Only lock files in data/user/files/