Code Duplication    Length = 6-7 lines in 2 locations

lib/private/legacy/util.php 2 locations

@@ 971-976 (lines=6) @@
968
	public static function checkDataDirectoryValidity($dataDirectory) {
969
		$l = \OC::$server->getL10N('lib');
970
		$errors = [];
971
		if ($dataDirectory[0] !== '/') {
972
			$errors[] = [
973
				'error' => $l->t('Your Data directory must be an absolute path'),
974
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
975
			];
976
		}
977
		if (!\file_exists($dataDirectory . '/.ocdata')) {
978
			$errors[] = [
979
				'error' => $l->t('Your Data directory  is invalid'),
@@ 977-983 (lines=7) @@
974
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
975
			];
976
		}
977
		if (!\file_exists($dataDirectory . '/.ocdata')) {
978
			$errors[] = [
979
				'error' => $l->t('Your Data directory  is invalid'),
980
				'hint' => $l->t('Please check that the data directory contains a file' .
981
					' ".ocdata" in its root.')
982
			];
983
		}
984
		return $errors;
985
	}
986