Code Duplication    Length = 16-16 lines in 2 locations

lib/private/Files/View.php 2 locations

@@ 2070-2085 (lines=16) @@
2067
	 *
2068
	 * @return bool False if the path is excluded from locking, true otherwise
2069
	 */
2070
	public function lockFile($path, $type, $lockMountPoint = false) {
2071
		$absolutePath = $this->getAbsolutePath($path);
2072
		$absolutePath = Filesystem::normalizePath($absolutePath);
2073
		if (!$this->shouldLockFile($absolutePath)) {
2074
			return false;
2075
		}
2076
2077
		$this->lockPath($path, $type, $lockMountPoint);
2078
2079
		$parents = $this->getParents($path);
2080
		foreach ($parents as $parent) {
2081
			$this->lockPath($parent, ILockingProvider::LOCK_SHARED);
2082
		}
2083
2084
		return true;
2085
	}
2086
2087
	/**
2088
	 * Unlock a path and all its parents up to the root of the view
@@ 2096-2111 (lines=16) @@
2093
	 *
2094
	 * @return bool False if the path is excluded from locking, true otherwise
2095
	 */
2096
	public function unlockFile($path, $type, $lockMountPoint = false) {
2097
		$absolutePath = $this->getAbsolutePath($path);
2098
		$absolutePath = Filesystem::normalizePath($absolutePath);
2099
		if (!$this->shouldLockFile($absolutePath)) {
2100
			return false;
2101
		}
2102
2103
		$this->unlockPath($path, $type, $lockMountPoint);
2104
2105
		$parents = $this->getParents($path);
2106
		foreach ($parents as $parent) {
2107
			$this->unlockPath($parent, ILockingProvider::LOCK_SHARED);
2108
		}
2109
2110
		return true;
2111
	}
2112
2113
	/**
2114
	 * Only lock files in data/user/files/