Code Duplication    Length = 6-7 lines in 2 locations

lib/private/legacy/util.php 2 locations

@@ 1034-1039 (lines=6) @@
1031
	public static function checkDataDirectoryValidity($dataDirectory) {
1032
		$l = \OC::$server->getL10N('lib');
1033
		$errors = [];
1034
		if ($dataDirectory[0] !== '/') {
1035
			$errors[] = [
1036
				'error' => $l->t('Your data directory must be an absolute path'),
1037
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1038
			];
1039
		}
1040
		if (!file_exists($dataDirectory . '/.ocdata')) {
1041
			$errors[] = [
1042
				'error' => $l->t('Your data directory is invalid'),
@@ 1040-1046 (lines=7) @@
1037
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1038
			];
1039
		}
1040
		if (!file_exists($dataDirectory . '/.ocdata')) {
1041
			$errors[] = [
1042
				'error' => $l->t('Your data directory is invalid'),
1043
				'hint' => $l->t('Ensure there is a file called ".ocdata"' .
1044
					' in the root of the data directory.')
1045
			];
1046
		}
1047
		return $errors;
1048
	}
1049