Code Duplication    Length = 16-16 lines in 2 locations

lib/private/Files/View.php 2 locations

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