Code Duplication    Length = 11-12 lines in 2 locations

apps/files_external/lib/Lib/Storage/Swift.php 1 location

@@ 89-99 (lines=11) @@
86
	/**
87
	 * @param string $path
88
	 */
89
	private function normalizePath($path) {
90
		$path = \trim($path, '/');
91
92
		if (!$path) {
93
			$path = '.';
94
		}
95
96
		$path = \str_replace('#', '%23', $path);
97
98
		return $path;
99
	}
100
101
	const SUBCONTAINER_FILE = '.subcontainers';
102

lib/private/Files/ObjectStore/ObjectStoreStorage.php 1 location

@@ 126-137 (lines=12) @@
123
	 * @param string $path
124
	 * @return string
125
	 */
126
	private function normalizePath($path) {
127
		$path = \trim($path, '/');
128
		//FIXME why do we sometimes get a path like 'files//username'?
129
		$path = \str_replace('//', '/', $path);
130
131
		// dirname('/folder') returns '.' but internally (in the cache) we store the root as ''
132
		if (!$path || $path === '.') {
133
			$path = '';
134
		}
135
136
		return $path;
137
	}
138
139
	/**
140
	 * Object Stores use a NoopScanner because metadata is directly stored in